#8098 closed enhancement (fixed)
Enhancement: Some `globalEval` optimizations
Reported by: | mathias | Owned by: | mathias |
---|---|---|---|
Priority: | low | Milestone: | 1.5.1 |
Component: | core | Version: | 1.5 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Apparently pull requests do not suffice and enhancement requests need their own bug ticket, so here goes.
I’ve made this pull request on GitHub: https://github.com/jquery/jquery/pull/205
The changes I made are some minor optimizations to globalEval
, namely:
- Use the speedy `document.head` when it’s available in
globalEval
. - Don’t set
script.type = text/javascript
as it’s not needed — all browsers default totext/javascript
if thetype
attribute is omitted (and it’s valid HTML too).
Change History (4)
comment:1 Changed 13 years ago by
Owner: | set to mathias |
---|---|
Status: | new → assigned |
comment:2 Changed 13 years ago by
Component: | unfiled → core |
---|---|
Milestone: | 1.next → 1.5.1 |
Priority: | undecided → low |
comment:3 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Fixes #8098. Use the fast document.head when available. Don't set unneeded "script.type = text/javascript".
Changeset: 462bb1f66abf239492ee33c60feee3402fe64f77
comment:4 Changed 13 years ago by
Version: | git → 1.5 |
---|
Note: See
TracTickets for help on using
tickets.
Bullet 1 is a no-brainer, but I'd like to see a
document.head || document.getElementsByTagName( "head" )[ 0 ] || document.documentElement
reference cached, because this is used elsewhere as well.I definitely agree with bullet 2, without question. As far as I'm concerned setting the type is a waste of characters.