Cyclic references DOM <-> JScript

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Jonas Jonsson (fatbrain_at_sphere.se)
Date: 11/02/04


Date: Tue, 2 Nov 2004 17:54:54 +0100

Hi

I've been here before asking about this but I've yet found a solution that
works 100%.

The problem is cyclic references between DOM and JScript as following:

var myDiv = document.createElement("div");
myDiv.onmousemove = function() { /* Here I reference myDiv, causes a memory
leak */ myDiv.innerHTML = "blah"; }

I've tried a solution which involved setting myDiv.onmousemove = null; in
window.onunload. But the memory leak is still present.

The code supplied above is an example of the code I'm using, I have heaps of
JScript / DOM scripts, and I "cleanse" them all on window.onunload.

If you need more information please ask and I'll do my best supplying it.

Best Regards / Jonas



Relevant Pages

  • Re: HTA - Refresh
    ... Strictly speaking it is not Java (JScript), but rather a part of the ... browser's document object model (DOM) which is language independent. ... That is it can be used in JScript or VBS, if the browser supports ...
    (microsoft.public.scripting.vbscript)
  • Re: HTA - Refresh
    ... Strictly speaking it is not Java (JScript), but rather a part of the ... browser's document object model (DOM) which is language independent. ... That is it can be used in JScript or VBS, if the browser supports ...
    (microsoft.public.scripting.vbscript)
  • Re: IE 7.0
    ... is already fully supported (expect for a few bugs here and there) in JScript and hence IE, ... Most of the standards focus for IE 7 has been on support for the W3C CSS 2, hence changes to the IE DOM appear to realted to CSS rather than full compliance with the W3C DOM, e.g.: ...
    (comp.lang.javascript)
  • Re: Syntax question
    ... between JScript and javascript? ... No. DOM issues have nothing to do with the language. ... find the language references and the Event Object documentation: ... the language and the DOM are separate for each browser. ...
    (microsoft.public.scripting.jscript)