Skip to main content

Bug Tracker

Side navigation

Ticket #3105: test-3105.html
File test-3105.html, 1.3 KB (added by dmethvin, January 06, 2009 10:52PM UTC)

Test case for #3105

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Document</title>
<script type="text/javascript" src="jquery-1.3b2.js"></script>
<script>

var ranScript = false, ranMeta = false;
$(document).ready(function(){
	if ( !ranScript )
		alert("Curious; script block didn't run");
	if ( ranMeta )
		alert("Curious; metadata was executed");

	ranScript = false;
	$('<script type="text/javascript">ranScript = true;</scr'+'ipt>').appendTo('body');
	if ( !ranScript )
		alert("Script test 1 failed");

	ranScript = false;
	$('<div><script type="text/javascript">ranScript = true;</scr'+'ipt></div>').appendTo('body');
	if ( !ranScript )
		alert("Script test 2 failed");

	ranScript = false;
	$('#script-test').appendTo('body');
	if ( ranScript )
		alert("Script test 3 failed");

	ranScript = false;
	$('#meta-test').appendTo('body');
	if ( ranScript || ranMeta )
		alert("Script test 4 failed");

}); 

</script>
</head>

<body>

<script type="text/javascript" id="script-test">
  ranScript = true;
</script>

<script id="meta-test" type="metadata">
  ranMeta = true;
</script>

</body>
</html>

Download in other formats:

Original Format