equals(result.text(),defaultText+'buga','Check if text appending works');
equals(result.text(),defaultText+'buga','Check if text appending works');
equals(jQuery('#select3').append('<option value="appendTest">Append Test</option>').find('option:last-child').attr('value'),'appendTest','Appending html options to select element');
equals(jQuery('#select3').append(valueObj('<option value="appendTest">Append Test</option>')).find('option:last-child').attr('value'),'appendTest','Appending html options to select element');
reset();
reset();
varexpected="This link has class=\"blog\": Simon Willison's WeblogTry them out:";
varexpected="This link has class=\"blog\": Simon Willison's WeblogTry them out:";
equals(result.text(),'buga'+defaultText,'Check if text prepending works');
equals(result.text(),'buga'+defaultText,'Check if text prepending works');
equals(jQuery('#select3').prepend('<option value="prependTest">Prepend Test</option>').find('option:first-child').attr('value'),'prependTest','Prepending html options to select element');
equals(jQuery('#select3').prepend(val('<option value="prependTest">Prepend Test</option>')).find('option:first-child').attr('value'),'prependTest','Prepending html options to select element');
reset();
reset();
varexpected="Try them out:This link has class=\"blog\": Simon Willison's Weblog";
varexpected="Try them out:This link has class=\"blog\": Simon Willison's Weblog";
equals($div.html(5).html(),'5','Setting a number as html');
equals($div.html(valueObj(5)).html(),'5','Setting a number as html');
equals($div.html(0).html(),'0','Setting a zero as html');
equals($div.html(valueObj(0)).html(),'0','Setting a zero as html');
reset();
reset();
jQuery("#main").html('<script type="something/else">ok( false, "Non-script evaluated." );</script><script type="text/javascript">ok( true, "text/javascript is evaluated." );</script><script>ok( true, "No type is evaluated." );</script><div><script type="text/javascript">ok( true, "Inner text/javascript is evaluated." );</script><script>ok( true, "Inner No type is evaluated." );</script><script type="something/else">ok( false, "Non-script evaluated." );</script></div>');
jQuery("#main").html(valueObj('<script type="something/else">ok( false, "Non-script evaluated." );</script><script type="text/javascript">ok( true, "text/javascript is evaluated." );</script><script>ok( true, "No type is evaluated." );</script><div><script type="text/javascript">ok( true, "Inner text/javascript is evaluated." );</script><script>ok( true, "Inner No type is evaluated." );</script><script type="something/else">ok( false, "Non-script evaluated." );</script></div>'));
stop();
stop();
jQuery("#main").html('<script type="text/javascript">ok( true, "jQuery().html().evalScripts() Evals Scripts Twice in Firefox, see #975" );</script>');
jQuery("#main").html(valueObj('<script type="text/javascript">ok( true, "jQuery().html().evalScripts() Evals Scripts Twice in Firefox, see #975" );</script>'));
jQuery("#main").html('foo <form><script type="text/javascript">ok( true, "jQuery().html().evalScripts() Evals Scripts Twice in Firefox, see #975" );</script></form>');
jQuery("#main").html(valueObj('foo <form><script type="text/javascript">ok( true, "jQuery().html().evalScripts() Evals Scripts Twice in Firefox, see #975" );</script></form>'));
// it was decided that waiting to execute ALL scripts makes sense since nested ones have to wait anyway so this test case is changed, see #1959
// it was decided that waiting to execute ALL scripts makes sense since nested ones have to wait anyway so this test case is changed, see #1959
jQuery("#main").html("<script>equals(jQuery.scriptorder++, 0, 'Script is executed in order');equals(jQuery('#scriptorder').length, 1,'Execute after html (even though appears before)')<\/script><span id='scriptorder'><script>equals(jQuery.scriptorder++, 1, 'Script (nested) is executed in order');equals(jQuery('#scriptorder').length, 1,'Execute after html')<\/script></span><script>equals(jQuery.scriptorder++, 2, 'Script (unnested) is executed in order');equals(jQuery('#scriptorder').length, 1,'Execute after html')<\/script>");
jQuery("#main").html(valueObj("<script>equals(jQuery.scriptorder++, 0, 'Script is executed in order');equals(jQuery('#scriptorder').length, 1,'Execute after html (even though appears before)')<\/script><span id='scriptorder'><script>equals(jQuery.scriptorder++, 1, 'Script (nested) is executed in order');equals(jQuery('#scriptorder').length, 1,'Execute after html')<\/script></span><script>equals(jQuery.scriptorder++, 2, 'Script (unnested) is executed in order');equals(jQuery('#scriptorder').length, 1,'Execute after html')<\/script>"));