468,740 Members | 2,000 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,740 developers. It's quick & easy.

how to find out what javascript is running

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
Nov 29 '07 #1
6 4047
Chris Curvey said the following on 11/29/2007 9:27 AM:
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?
Any way you find is going to fall into the category of "debugging".

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Nov 29 '07 #2
Chris Curvey wrote:
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.
Nov 29 '07 #3
On Nov 29, 9:27 am, Chris Curvey <ccur...@gmail.comwrote:
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
Nov 29 '07 #4
VUNETdotUS wrote:
>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?
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
You can't do what the OP wants though. Make it "interrupt" the currently
running script.
Nov 29 '07 #5
Chris Curvey wrote:
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
Nov 29 '07 #6
Response to Stevo <pl****@spam-me.com>:
VUNETdotUS wrote:
>>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?
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

You can't do what the OP wants though. Make it "interrupt" the
currently running script.
I believe that is what the breakpoints are for.

--
-Lost
Remove the extra words to reply by e-mail. Don't e-mail me. I am
kidding. No I am not.
Dec 4 '07 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Fabrice Labrousse | last post: by
27 posts views Thread by one man army | last post: by
3 posts views Thread by =?Utf-8?B?R3JlZyBN?= | last post: by
2 posts views Thread by daniel_nolan | last post: by
11 posts views Thread by Helmut Jarausch | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.