debugging javascript code

P

Peter Rilling

I usually place the "debugging;" (or "debugger;", I can't remember)
statement in my code. When this statement is executed, VS.NET will launch
and let you step through your code. In IE, you will have to enable script
debugging from IE's options.
 
J

John M

Hello,

In Microsoft Visual Studio .NET 2003,

How can I debug javascript/vbscript codes (client side) ?

Thanks :)
 
P

Peter Rilling

Suppose you have your JS something like the following:

function MyFunc1(){
// do something.

debugger; // This will cause IE to launch the VS.NET when
//encountered and script debugging is turned
on.
//The script page will be loaded into the
IDE.

MyFunc2();

// dosomething.
}

function MyFunc2(){
// do something.
}
 
K

Kevin Spencer

Yo also have to change IE's settings to allow client-side debugging. This is
turned off by default. Default of whom, you ask? Default of Microsoft! ;-)

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.
 
K

Kevin Spencer

Tools|Internet Options|Advanced Tab.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.
 
J

John M

In IE 6.0 - Where is that option ?

Thanks :)

Kevin Spencer said:
Yo also have to change IE's settings to allow client-side debugging. This
is turned off by default. Default of whom, you ask? Default of Microsoft!
;-)

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
What You Seek Is What You Get.
 
A

Andrew D. Newbould

Kevin Spencer said:
Tools|Internet Options|Advanced Tab.

Personally, the best tool for debugging client side JavaScript is to use
the Mozilla web browser as you get a full debugger and script console
built in.

Kind Regards,
 
J

John M

Solved, thanks :)
(and uncheck the disable script debugging for internet explorer & other).

Thanks :)
 
K

Kevin Spencer

(and uncheck the disable script debugging for internet explorer & other).

I presumed you would guess that part! ;-)

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.
 
K

Kevin Spencer

Personally, the best tool for debugging client side JavaScript is to use
the Mozilla web browser

Better than Visual Studio.Net? Hmmmmmmmmmmm.....................no.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.
 
A

Andrew D. Newbould

Kevin Spencer said:
Better than Visual Studio.Net? Hmmmmmmmmmmm.....................no.

Sorry Kevin ...

I thought I was in a VB Classic newsgroup when I responded not the .Net
ones. Still, Mozilla is still better than IE for some things.

Kind Regards,
 
K

Kevin Spencer

Still, Mozilla is still better than IE for some things.

Sure. For debugging the Mozilla DOM-specific JavaScript interaction. But the
same could be said for any debugger, since none that I know of debug for
more than one browser. So, all other things being equal, it could not be
(overall) better than VS.Net, which does everything that every other
debugger does and then some.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Sometimes you eat the elephant.
Sometimes the elephant eats you.
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top