jquery - iframe based IE6 javascript memory leak? -


I'm loading the material using an iframe through a menu with jquery that iframe's 'src' Updating the attribute then load it into the desired page. Each page has its own javascript and contains heavy content.

The code is as follows: -

  $ (document) .ready (function () {loadPage ('Main.php');}); Function load page (url) {$ ('# applicationFrame'). Attr ('src', url); }  

And iframe on the index page looks like: -

    

(Side note: making me realize that even iframe non-standard features, but which one is an internal intranet applications that were running in a Microsoft HTA Anything they mean are:

Anyway, the menu items are just calling Javascript: loadPage ('whatever.php') is necessary to load into whatever content.

The problem are leaking frames memory On each subsequent page of the menu is facing the I 'm until full app reports following SIEve can not slow down a crawl The leak column is increasing with every click (21 -> 44 -> 65), etc.: -

The leak detecting inspector shows:

I feel that this is completely irrelevant material that has been leaked.

Is there no way to avoid this? Am I forgetting something? I have found a problem similar to the dojo framework, but trying out the suggested solutions does not work. I have even put a bunch of other things pasted, but there is no resolution.

This only (surprisingly) affects IE6 which is actually the only target audience of the application.

There was little time in hand and a lower version of jQuery was tried according to SIEve no more appears to be.

  function pos (obj) {var curleft = 0; Var curtop = 0; If (obj.offsetParent) {do {curleft + = obj.offsetLeft; Curtop + = obj.offsetTop; } While (obj = obj.offsetParent); } Obj = null; Returns {Left: Cuba, Top: Cropper}; } Function load page (url) {var y = document.getElementById ('container'); Var x = document.getElementById ('applicationframe'); Var p = pos (y); If (x.src) {var tmp = y.cloneNode (wrong); Var tmpIF = x.cloneNode (wrong); TmpIF.src = url; Tmp.appendChild (tmpif); Tmp.style.position = 'Done'; Tmp.style.visibility = 'hidden'; Tmp.style ["z-index"] = 20; Tmp.style.top = p.top; Tmp.style.left = p.left; Y.id = "Delete"; X.id = "Delete applicationsframeframe"; Document.getElementsByTagName ("body") [0] .appendChild (tmp); TmpIF = null; Tmp = null; } SetTimeout ( "document.getElementById ( 'applicationFrame') style. Visibility = 'visible'; var i = document.getElementById ( 'deleteApplicationFrame'); i = i.contentDocument || i.contentWindow.document; i.documentElement ParentNode. removeChild (i.documentElement); i = null; i = document. getElementById (Delete ''); i.parentNode.removeChild (i); i = null; ", 500); Y = null; X = Null; P = null; } & Lt; Div id = "container" & gt; & Lt; Iframe id = "applicationFrame" application = "yes" trusted = "yes" framesborder = "0" src = "main.php" /> & Lt; / Div & gt;  

It is very difficult to tell what is probably going on without knowing the whole application. Especially with a IE 6 memory leak, there is a BOC.

Some reading links


There was just one thought, When setting the src in a different value, the behavior AFAIK is not actually specified in the W3C HTML DOM specification or is it (anyone has links?)?

I recommend that you set an initial src = "main.php" value to an iframe instead of using loadPage ('main.php'); and set a name for iframe.

Ideally your menu item is and gtc: tags, then you & lt; a href = "notmain.php can test using" target = "nameOfYourIFrame" to "& Gt; Fubar & lt; / a & gt; JavaScript instead of based solutions


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -