mirror of
https://github.com/jquery/jquery.git
synced 2026-04-20 03:01:22 -04:00
Fixes #8098. Use the fast document.head when available. Don't set unneeded "script.type = text/javascript".
This commit is contained in:
@@ -574,10 +574,8 @@ jQuery.extend({
|
||||
if ( data && rnotwhite.test(data) ) {
|
||||
// Inspired by code by Andrea Giammarchi
|
||||
// http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
|
||||
var head = document.getElementsByTagName("head")[0] || document.documentElement,
|
||||
script = document.createElement("script");
|
||||
|
||||
script.type = "text/javascript";
|
||||
var head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement,
|
||||
script = document.createElement( "script" );
|
||||
|
||||
if ( jQuery.support.scriptEval() ) {
|
||||
script.appendChild( document.createTextNode( data ) );
|
||||
|
||||
Reference in New Issue
Block a user