jquery dom element construction within frame causing divs to leak
jQuery Version: 1.2.3
Internet Explorer Version: 6 or 7
In the following example SIEVE will report two leaks for every time
leak() is called only when the page is inside a frame. If this html
is served itself as the main page it will not report a leak BUT if
it's served inside the below frameset these two leaks are reported
each time the leak() function is called: <div>div<div></div>
It obviously does not have anything to do with the append function as
the noleak function (which doens't leak) also uses append. It happens
anytime you create dom objects using $("...").
<frameset rows="*" framespacing="0" border="false" frameborder="0">
<frame src="frame.htm" frameborder="0">
</frameset>
<!-- frame.htm source -->
<html>
<script language="javascript" src="jquery-1.2.3.min.js"></script>
<script>
$(document).ready(function(){
});
function leak(){
$("#mydiv").append(":leak ");
}
function noleak(){
var text = document.createTextNode(':noleak ');
$("#mydiv").append(text);
}
</script>
<body >
<div id="mydiv">should be appended here</div><br/>
<a href="#" onclick="leak();">leak</a><br/>
<a href="#" onclick="noleak();">noleak</a><br/>
</body>
</html>