jQuery: The Write Less, Do More JavaScript Library

Re: Cleaning up javascript before ajax load

by waseem sabjee :: Rate this Message:

Reply to Author | View in Thread

well if the js from that page is in the head tag
you can extract everything from in-between the body tags and leave out the js

another way would be to cycle through each element - and do not take across any script tags.

If that js executes it will be held in the memory.

On Tue, Jun 30, 2009 at 10:18 AM, Veeru <swamyveera@...> wrote:

Hi there
I have an ajax based page, which loads content from external page (html
+js)

So if i have a div "update_div" being updated with external content
(html+js)
Let me be more specifig

Step1: Ajax content along with js loaded into update_div from a.html

Step2: Ajax content along with js loaded into update_div from b.html

What happens to the js loaded from a.html? Is it lurking in the memory
or automatically/magically removed from the browser memory?
I am afraid of memory leaks, if the js is still lurking in memory, the
more ajax calls made, the more js is going to be held up in memory.

Unless am totally wrong; i have no idea of the mechanism happening
here. Can somebody shed some ligth?

p.s: Hope my post doest go missing this time :)

Thanks
Vru

 « Return to Thread: Cleaning up javascript before ajax load