Re: [jQuery] javascript loaded via ajax

2010-01-13 Thread Nathan Klatt
On Wed, Jan 13, 2010 at 6:45 PM, Michael Geary wrote: > In your example, the hello function will never be garbage collected, because > the window object has a property named 'hello' that holds a reference to the > function. Thanks for the correction. Nathan

Re: [jQuery] javascript loaded via ajax

2010-01-13 Thread Michael Geary
Removing a element just removes the script's *source code* from the DOM. It doesn't undo any actions that the script has already performed, such as defining functions or variables or creating other DOM elements. It doesn't change their availability for garbage collection at all. In your example,

Re: [jQuery] javascript loaded via ajax

2010-01-13 Thread Nathan Klatt
On Wed, Jan 13, 2010 at 1:53 PM, nihal wrote: > is there anyway to remove the newly added function from the dom? Wrap the code you want to be removeable in its own element, give it an id, then remove it just like any other element. As has been discussed today, removing it doesn't mean *poof* it'

[jQuery] javascript loaded via ajax

2010-01-13 Thread nihal
hi i have a div whose content is loaded via ajax..that content contains html+javascript the javascript contains a function called test() when the content is loaded this function is added to the dom...now when i remove the div using remove(); i am still able to run the function test() as its still