how to find out what javascript is running

C

Chris Curvey

Hi All,

I have inherited a web page that includes lots of javascript. When I
click on some things, the CPU utilization on the browser machine goes
to 100% and the browser becomes unresponsive until it is done doing
whatever it is doing.

Is there any clever way (in any browser) to interrupt or pause the
execution of the javascript so that I can identify what is running
that is taking so long?

-Chris
 
S

Stevo

Chris said:
Is there any clever way (in any browser) to interrupt or pause the
execution of the javascript so that I can identify what is running
that is taking so long?

If you install MSD (Microsoft Script Debugger) or Visual Studio, then in
IE, you can select View->ScriptDebugger->Break at Next Statement, and it
will stop immediately on the next executed line of script. In Visual
Studio you can look at the call stack and find out where you are and
where you came from.

I think there's a tool from Yahoo (the YUI team) that will show you
what's going on in your script. It's meant for performance tweaking. I
tried it once for a couple of minutes. I think it's called YSlow (or
something like that) and runs in Firefox.
 
V

VUNETdotUS

Hi All,

I have inherited a web page that includes lots of javascript. When I
click on some things, the CPU utilization on the browser machine goes
to 100% and the browser becomes unresponsive until it is done doing
whatever it is doing.

Is there any clever way (in any browser) to interrupt or pause the
execution of the javascript so that I can identify what is running
that is taking so long?

-Chris

The best JavaScript debugger I've seen is "Firebug" for Firefox. You
can edit, debug, and monitor CSS, HTML, and JavaScript live in any web
page: https://addons.mozilla.org/en-US/firefox/addon/1843

www.vunet.us
www.worldincatalog.com
 
E

Erwin Moller

Chris said:
Hi All,

I have inherited a web page that includes lots of javascript. When I
click on some things, the CPU utilization on the browser machine goes
to 100% and the browser becomes unresponsive until it is done doing
whatever it is doing.

Is there any clever way (in any browser) to interrupt or pause the
execution of the javascript so that I can identify what is running
that is taking so long?

-Chris

Hi,

A few strategically placed alerts() can help a lot to pin down the part
that is demanding a lot of the CPU.
Simply examine the scripts, do an alert before something starts.
During the alert-box javascript waits for you to press ok.
If it takes a long time to the next alert, you know roughly where to
investigate futher.

It is not the most elegant way, but it helped me out a few times. :)

Regards,
Erwin Moller
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,778
Messages
2,569,605
Members
45,238
Latest member
Top CryptoPodcasts

Latest Threads

Top