Bug Tracker

Modify

Ticket #2483 (closed bug: worksforme)

Opened 5 years ago

Last modified 3 years ago

jquery dom element construction within frame causing elements to leak

Reported by: sestizac Owned by:
Priority: major Milestone:
Component: core Version: 1.2.3
Keywords: leak, leaks, div<div>, frames, framesets Cc:
Blocking: Blocked by:

Description

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></div>

It 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 $("..."). In my project we are dynamically creating a large table and each node in the table is reported as leaking when leaving the page. If I remove the frameset these nodes do not leak.

<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>

Change History

comment:1 Changed 3 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to worksforme

I don't see an increase in memory with 1.4.2 and IE8 so I'll close this ticket.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.