Fixes #8098. Use the fast document.head when available. Don't set unneeded "script.type = text/javascript".
parent
fdd4101fe9
commit
462bb1f66a
|
@ -524,11 +524,9 @@ jQuery.extend({
|
||||||
if ( data && rnotwhite.test(data) ) {
|
if ( data && rnotwhite.test(data) ) {
|
||||||
// Inspired by code by Andrea Giammarchi
|
// Inspired by code by Andrea Giammarchi
|
||||||
// http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
|
// http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
|
||||||
var head = document.getElementsByTagName("head")[0] || document.documentElement,
|
var head = document.head || document.getElementsByTagName("head")[0] || document.documentElement,
|
||||||
script = document.createElement("script");
|
script = document.createElement("script");
|
||||||
|
|
||||||
script.type = "text/javascript";
|
|
||||||
|
|
||||||
if ( jQuery.support.scriptEval ) {
|
if ( jQuery.support.scriptEval ) {
|
||||||
script.appendChild( document.createTextNode( data ) );
|
script.appendChild( document.createTextNode( data ) );
|
||||||
} else {
|
} else {
|
||||||
|
@ -5060,7 +5058,7 @@ jQuery.extend({
|
||||||
// If we're requesting a remote document
|
// If we're requesting a remote document
|
||||||
// and trying to load JSON or Script with a GET
|
// and trying to load JSON or Script with a GET
|
||||||
if ( s.dataType === "script" && type === "GET" && remote ) {
|
if ( s.dataType === "script" && type === "GET" && remote ) {
|
||||||
var head = document.getElementsByTagName("head")[0] || document.documentElement;
|
var head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement;
|
||||||
var script = document.createElement("script");
|
var script = document.createElement("script");
|
||||||
script.src = s.url;
|
script.src = s.url;
|
||||||
if ( s.scriptCharset ) {
|
if ( s.scriptCharset ) {
|
||||||
|
|
|
@ -34,7 +34,7 @@ jQuery.ajaxTransport( "script", function(s) {
|
||||||
if ( s.crossDomain ) {
|
if ( s.crossDomain ) {
|
||||||
|
|
||||||
var script,
|
var script,
|
||||||
head = document.getElementsByTagName( "head" )[ 0 ] || document.documentElement;
|
head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
||||||
|
|
|
@ -574,10 +574,8 @@ jQuery.extend({
|
||||||
if ( data && rnotwhite.test(data) ) {
|
if ( data && rnotwhite.test(data) ) {
|
||||||
// Inspired by code by Andrea Giammarchi
|
// Inspired by code by Andrea Giammarchi
|
||||||
// http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
|
// http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
|
||||||
var head = document.getElementsByTagName("head")[0] || document.documentElement,
|
var head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement,
|
||||||
script = document.createElement("script");
|
script = document.createElement( "script" );
|
||||||
|
|
||||||
script.type = "text/javascript";
|
|
||||||
|
|
||||||
if ( jQuery.support.scriptEval() ) {
|
if ( jQuery.support.scriptEval() ) {
|
||||||
script.appendChild( document.createTextNode( data ) );
|
script.appendChild( document.createTextNode( data ) );
|
||||||
|
|
|
@ -7,7 +7,7 @@ var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
|
||||||
rtbody = /<tbody/i,
|
rtbody = /<tbody/i,
|
||||||
rhtml = /<|&#?\w+;/,
|
rhtml = /<|&#?\w+;/,
|
||||||
rnocache = /<(?:script|object|embed|option|style)/i,
|
rnocache = /<(?:script|object|embed|option|style)/i,
|
||||||
// checked="checked" or checked (html5)
|
// checked="checked" or checked
|
||||||
rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
|
rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
|
||||||
wrapMap = {
|
wrapMap = {
|
||||||
option: [ 1, "<select multiple='multiple'>", "</select>" ],
|
option: [ 1, "<select multiple='multiple'>", "</select>" ],
|
||||||
|
|
Loading…
Reference in New Issue