fixture.html(valueObj("<script type='text/javascript'>ok( true, 'Injection of identical script' );</script>"));
fixture.html(valueObj("<script type='text/javascript'>ok( true, 'Injection of identical script' );</script>"));
equal(child.length,2,"Make sure that two non-JavaScript script tags are left.");
fixture.html(valueObj("<script type='text/javascript'>ok( true, 'Injection of identical script' );</script>"));
equal(child[0].type,"something/else","Verify type of script tag.");
fixture.html(valueObj("foo <form><script type='text/javascript'>ok( true, 'Injection of identical script (#975)' );</script></form>"));
equal(child[1].type,"something/else","Verify type of script tag.");
jQuery.scriptorder=0;
jQuery("#qunit-fixture").html(valueObj("<script>ok( true, 'Test repeated injection of script.' );</script>"));
fixture.html(valueObj([
jQuery("#qunit-fixture").html(valueObj("<script>ok( true, 'Test repeated injection of script.' );</script>"));
"<script>",
jQuery("#qunit-fixture").html(valueObj("<script>ok( true, 'Test repeated injection of script.' );</script>"));
"equal( jQuery('#scriptorder').length, 1,'Execute after html' );",
"equal( jQuery.scriptorder++, 0, 'Script is executed in order' );",
jQuery("#qunit-fixture").html(valueObj("<script type='text/javascript'>ok( true, 'jQuery().html().evalScripts() Evals Scripts Twice in Firefox, see #975 (1)' );</script>"));
"</script>",
"<span id='scriptorder'><script>equal( jQuery.scriptorder++, 1, 'Script (nested) is executed in order');</script></span>",
jQuery("#qunit-fixture").html(valueObj("foo <form><script type='text/javascript'>ok( true, 'jQuery().html().evalScripts() Evals Scripts Twice in Firefox, see #975 (2)' );</script></form>"));
"<script>equal( jQuery.scriptorder++, 2, 'Script (unnested) is executed in order' );</script>"
].join("")));
jQuery("#qunit-fixture").html(valueObj("<script>equal(jQuery.scriptorder++, 0, 'Script is executed in order');equal(jQuery('#scriptorder').length, 1,'Execute after html (even though appears before)')<\/script><span id='scriptorder'><script>equal(jQuery.scriptorder++, 1, 'Script (nested) is executed in order');equal(jQuery('#scriptorder').length, 1,'Execute after html')<\/script></span><script>equal(jQuery.scriptorder++, 2, 'Script (unnested) is executed in order');equal(jQuery('#scriptorder').length, 1,'Execute after html')<\/script>"));
QUnit.reset();
fixture.html(valueObj(fixture.text()));
ok(/^[^<]*[^<\s][^<]*$/.test(fixture.html()),"Replace html with text");
};
};
test("html(String)",function(){
test("html(String)",function(){
testHtml(manipulationBareObj);
testHtml(manipulationBareObj);
});
});
test("html(Function)",function(){
test("html(Function)",function(){
testHtml(manipulationFunctionReturningObj);
testHtml(manipulationFunctionReturningObj);
expect(37);
QUnit.reset();
jQuery("#qunit-fixture").html(function(){
returnjQuery(this).text();
});
ok(!/</.test(jQuery("#qunit-fixture").html()),"Replace html with text.");
ok(jQuery("#qunit-fixture").html().length>0,"Make sure text exists.");
});
});
test("html(Function) with incoming value",function(){
test("html(Function) with incoming value",function(){
...
@@ -2083,3 +2110,59 @@ testIframeWithCallback( "buildFragment works even if document[0] is iframe's win
...
@@ -2083,3 +2110,59 @@ testIframeWithCallback( "buildFragment works even if document[0] is iframe's win