Clientside debugging

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Sometimes I get an exception in the browser and I get prompted to start
Visual Studio 2005 for debugging.
Sometimes I would like to start client side debugging on demand. How can I
do that?
 
with the client debugger of choice, attach to the ie instance of choice and
check script debugging.

-- bruce (sqlwork.com)
 
Sometimes I get an exception in the browser and I get prompted to start
Visual Studio 2005 for debugging.
Sometimes I would like to start client side debugging on demand. How can I
do that?

Presumably, you mean debugging Javascript in IE...?

If so, the following is pretty much guaranteed to work:

1) Download and install the Microsoft Script Debugger
http://www.microsoft.com/downloads/...e0-94fd-4569-b3c4-dffdf19ccd99&DisplayLang=en

2) In IE, click Tools, Internet Options and select the Advanced tab and make
sure Disable Script Debugging (Internet Explorer) is NOT checked

3) In your client-side Javascript, insert the word debugger; where you want
your code to break. E.g.

<script>

function myFunction()
{
debugger; // code execution will break here
alert('Hello world');
}

4) Click F5 to start your app. When you navigate to the page in question,
you can debug your client-side Javascript just like you would debug your
server-side code i.e. with F10, F11 etc, interrogate locals, use the
Immediate window etc...
 
I am not able to find script debugging check box. What screen are you talking
about?
--
Arne Garvander
(I program VB.Net for fun and C# to get paid.)


bruce barker (sqlwork.com) said:
with the client debugger of choice, attach to the ie instance of choice and
check script debugging.

-- bruce (sqlwork.com)
 
Actually I have a mixed Javascript and VBscript environment. Today I am
having a problem in client-side VBScript. Will your idea work with VBScript
also?
 
Hi,

Mark said:
Presumably, you mean debugging Javascript in IE...?

If so, the following is pretty much guaranteed to work:

1) Download and install the Microsoft Script Debugger
http://www.microsoft.com/downloads/...e0-94fd-4569-b3c4-dffdf19ccd99&DisplayLang=en

Since the OP has Visual Studio 2005, why use the Microsoft Script
debugger? Simply use Visual Studio's own script debugger, which is
better anyway.

In Studio 2005, with IE running, select the menu Debug / Attach to
process, select the correct instance of IE, and click Attach.

Alternative: Place a breakpoint in your JavaScript code and press F5 to
start in debug mode.
2) In IE, click Tools, Internet Options and select the Advanced tab and make
sure Disable Script Debugging (Internet Explorer) is NOT checked

That's true with VS2005 too.

HTH,
Laurent
 
Mark,
I wrote a Javascript wrapper for my Vbscript problem and now I am back in
business.
I you would like to send me your address I'll send you a $5 tip for your
excellent help!
 
Arne,
I you would like to send me your address I'll send you a $5 tip for your
excellent help!

I'm pleased to have been able to help you.

This is a peer-to-peer newsgroup where people help each other because they
want to - neither I nor anyone else requires nor expects payment for this.

However, if you feel so inclined, please donate the $5 to a charity of your
choice.

Or take the person you love most in the world (so long as that's not
yourself!) out to a decent bar and buy them a drink from me... :-)
 
Most of my problems are in VBScript and I was not able to get my breakpoints
to work in Visual Studio 2005. Mark's idea worked great even without
downloading the debugger.
 
That's right. A tip should never be required or expected. A tip should be
100% voluntary.
The tip was declined and redirected. I'll put my gratitude in the bit bucket
since my beloved doesn't visit bars.
 
In Studio 2005, with IE running, select the menu Debug / Attach to
process, select the correct instance of IE, and click Attach.
Alternative: Place a breakpoint in your JavaScript code and press F5 to
start in debug mode.

The second option is far easier.
 
Hi,

Mark said:
The second option is far easier.

Not always. When you need to debug a lot, the first is very much faster,
especially if you set a keyboard-shortcut to display the "attach to
process" dialog.

HTH,
Laurent
 
Hi, to debug VBscript , just put a 'stop' statement in your function. This
will invoke the debugger.
 
That's right. A tip should never be required or expected. A tip should be
100% voluntary.
The tip was declined and redirected. I'll put my gratitude in the bit
bucket
since my beloved doesn't visit bars.

That's cool.
 

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

Back
Top