Bug Tracker

Ticket #3105: test-3105.html

File test-3105.html, 1.3 KB (added by dmethvin, 11 years ago)

Test case for #3105

Line 
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml">
3<head>
4<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5<title>Document</title>
6<script type="text/javascript" src="jquery-1.3b2.js"></script>
7<script>
8
9var ranScript = false, ranMeta = false;
10$(document).ready(function(){
11        if ( !ranScript )
12                alert("Curious; script block didn't run");
13        if ( ranMeta )
14                alert("Curious; metadata was executed");
15
16        ranScript = false;
17        $('<script type="text/javascript">ranScript = true;</scr'+'ipt>').appendTo('body');
18        if ( !ranScript )
19                alert("Script test 1 failed");
20
21        ranScript = false;
22        $('<div><script type="text/javascript">ranScript = true;</scr'+'ipt></div>').appendTo('body');
23        if ( !ranScript )
24                alert("Script test 2 failed");
25
26        ranScript = false;
27        $('#script-test').appendTo('body');
28        if ( ranScript )
29                alert("Script test 3 failed");
30
31        ranScript = false;
32        $('#meta-test').appendTo('body');
33        if ( ranScript || ranMeta )
34                alert("Script test 4 failed");
35
36}); 
37
38</script>
39</head>
40
41<body>
42
43<script type="text/javascript" id="script-test">
44  ranScript = true;
45</script>
46
47<script id="meta-test" type="metadata">
48  ranMeta = true;
49</script>
50
51</body>
52</html>