Hello all,
I’ve been fighting around with this issue for a few days now, that’s why I’m raising this thread.
I’ve also researched the web in vain…
Maybe someone has run into something like this before…
Algorithm outline: (in the context of handling inline scripts – pseudo code)
Preconditions:
– Fetch the HEAD and BODY of the target page into jQuery variables (head and body)– Filter out <links> and <scripts> in the HEAD (works)– Filter out <scripts> in the BODY with
[CODE]bjss = body.find(“scripts”);
$s.t = bjss.filter(function() { return !$(this).attr(‘src’); });
When debugging, I can see that
$s.t correctly holds some inline scripts.
Then call another function, that does not manipulate $s.t.
In the final function call, that is supposed to handle the inline scripts,
[CODE]$s.t
…for some reason is empty:
[CODE
[B]How can a jQuery selection just disappear more or less from “one line to the next”?
EDIT:
[url]http://stackoverflow.com/questions/4644799/javascript-variables-are-disappearing
It could be related to the above thread, as I’m passing back inner variables of “sub-plugins” up to its clients.
But if that’s the case, I’d have to refactor the code heavily, as the same symptoms could arise anywhere it future randomly.
The way I understood garbage collection in JavaScript, as long as there is a reference to data remaining, it is not collected?
[B]What’s best practice for sharing data across function calls
Thanks in advance and
Kind regards