Conex
Conex

Reputation: 822

Common techniques of cleaning memory in jquery

I'm trying to debug some code that another developer wrote in jquery since page loads really slow and crashes the browser. I need an advice how to test , debug big amounts of jquery code. Need some good techniques in memory cleanup in point of view of existing code written by somebody else. All the suggestions , tools , relevant links will be greatly appreciated. I'm using firebug to debug the code.

Thanks for your time.

Upvotes: 1

Views: 140

Answers (2)

kobe
kobe

Reputation: 15835

go through this onload function , whatever code inside the below method gets executed onthe load of the page.Go through the code and identity all for loops , global variables , string concatination , null checks , div exists checks...

With the above things you can fix some...issues

run profiling in firebug also ,

 $(document).ready(function() {
    // check for all null checks properly
// check global variables
// check forloops
// check circular references
     });

Upvotes: 2

Chip Hunt
Chip Hunt

Reputation: 136

QUnit http://docs.jquery.com/Qunit

Upvotes: 2

Related Questions