jQuery: The Write Less, Do More JavaScript Library

Ticket #1628: bug.html

File bug.html, 0.8 kB (added by xhva, 1 year ago)

Minimised testcase for JQuery 1.2 IE6 clone/append DOM result bug

Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2<html>
3    <head>
4        <title>test</title>
5        <script type="text/javascript" src="http://jqueryjs.googlecode.com/files/jquery-1.2.js"></script>
6        <script type="text/javascript">
7            $(document).ready(function(){
8                // clone p
9                $("body p:last").clone().appendTo("body");
10
11                // show the length using jq and dom calls
12                alert("We clone an existing paragraph in body.\n" +
13                      "Paragraph count returned using:\n\n" +
14                      "jq: " + $("body p").length + "\n" +
15                      "dom: " + document.getElementsByTagName("body")[0]
16                                        .getElementsByTagName("p").length);
17            });
18        </script>
19    </head>
20
21    <body>
22        <p>Blah</p>
23    </body>
24</html>