Changeset 3296
- Timestamp:
- 09/15/07 02:16:29 (1 year ago)
- Location:
- trunk/jquery
- Files:
-
- 2 modified
-
src/core.js (modified) (1 diff)
-
test/unit/core.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/jquery/src/core.js
r3281 r3296 395 395 396 396 jQuery.each( a, function(){ 397 if ( jQuery.nodeName(this, "script") ) { 398 if ( this.src ) 399 jQuery.ajax({ url: this.src, async: false, dataType: "script" }); 400 else 401 jQuery.globalEval( this.text || this.textContent || this.innerHTML || "" ); 402 } else 403 fn.apply( obj, [ clone ? this.cloneNode(true) : this ] ); 397 var elem = clone ? this.cloneNode(true) : this; 398 if ( !evalScript(0, elem) ) 399 fn.call( obj, elem ); 404 400 }); 405 401 }); 406 402 } 407 403 }; 404 405 function evalScript(i, elem){ 406 var script = jQuery.nodeName(elem, "script"); 407 408 if ( script ) { 409 if ( elem.src ) 410 jQuery.ajax({ url: elem.src, async: false, dataType: "script" }); 411 else 412 jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" ); 413 414 if ( elem.parentNode ) 415 elem.parentNode.removeChild(elem); 416 417 } else if ( elem.nodeType == 1 ) 418 jQuery("script", elem).each(evalScript); 419 420 return script; 421 } 408 422 409 423 jQuery.extend = jQuery.fn.extend = function() { -
trunk/jquery/test/unit/core.js
r3139 r3296 822 822 823 823 test("html(String)", function() { 824 expect( 1);824 expect(3); 825 825 var div = $("div"); 826 826 div.html("<b>test</b>"); … … 831 831 ok( pass, "Set HTML" ); 832 832 833 // Ccommented out until we can resolve it 834 // $("#main").html('<script type="text/javascript">ok( true, "$().html().evalScripts() Evals Scripts Twice in Firefox, see #975" );</script>').evalScripts(); 833 stop(); 834 835 $("#main").html('<script type="text/javascript">ok( true, "$().html().evalScripts() Evals Scripts Twice in Firefox, see #975" );</script>'); 836 837 $("#main").html('foo <form><script type="text/javascript">ok( true, "$().html().evalScripts() Evals Scripts Twice in Firefox, see #975" );</script></form>'); 838 839 setTimeout( start, 100 ); 835 840 }); 836 841