How can I debug javascript ?

A

Alex Nitulescu

I have the option 'Just in time debugging' set as CLR/Native/Script. In
Project Properties/Debuggers I have ASP.NET debugging.

Still, although I have breakpoints set everywhere in my javascript, ,
inluding on "function Init()", the execution it never stops anywhere, and I
have NO idea of why my code does not appear to do anything.

Thank you.
Alex.
 
D

Derek Harmon

Alex Nitulescu said:
I have the option 'Just in time debugging' set as CLR/Native/Script. In Project Properties/Debuggers I have ASP.NET debugging.
Still, although I have breakpoints set everywhere in my javascript, ,

If you've recently installed XP Service Pack 2, you may have to go
into Internet Explorer | Tools | Internet Options ... | Advanced |
Disabled Script Debugging and un-check that box.

If Internet Explorer doesn't allow the debugger to attach to the
..dll hosting the script host then this will make your Running
Documents window appear empty, and XP SP2 will disable
this debugging even if you had previously had it enabled before
installing SP2.
inluding on "function Init()", the execution it never stops anywhere, and I have NO idea of why my code does not appear to do
anything.

Another thing you can do is just insert the following script block in
the <head> of your HTML (or .aspx) document,

<script language="javascript"><!--
debugger;
--></script>

Or instead of breaking into the debugger (note this won't break into
the debugger is debugging is disabled within the browser), call your
Init( ) function directly. This should ensure it at least gets called. :)


Derek Harmon
 

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

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top