How to debug client-side script (javascript) from VS2003 or VS2005?

Discussion in 'ASP .Net' started by ABC, Dec 29, 2005.

  1. ABC

    ABC Guest

    How to debug client-side script (javascript) from VS2003 or VS2005?
     
    ABC, Dec 29, 2005
    #1
    1. Advertising

  2. javascript:window.alert(document.getElementById("ctrl_id").form.id);

    You'll find the above statement very useful in detecting "form deteched
    controls because of improperly closed tag".

    Anyway, you'll want to insert window.alert() statement everywhere when
    debugging to act as breakpoint for your javascript functions.

    And I also find the "Javascript Console" of Firefox very useful.

    "ABC" <> ¼¶¼g©ó¶l¥ó·s»D:%...
    > How to debug client-side script (javascript) from VS2003 or VS2005?
    >
    >
     
    Lau Lei Cheong, Dec 29, 2005
    #2
    1. Advertising

  3. =?Utf-8?B?RWx0b24gVw==?=, Dec 29, 2005
    #3
  4. ABC

    Marina Guest

    Here are 2 ways:

    1. put in the 'debugger' statement. When the browser reaches this statement,
    it will pop up a message box asking if you want to debug. You can then
    select a new or existing instance of VS and go from there. You must have
    debugging enabled in your browser and specify that you want to be notified
    of every script error, or else you won't get this pop up.
    2. Attach to the iexplorer.exe process that is running your page using VS.
    You should be able to set breakpoints, etc.

    However, as an aside, method 2 though this does sometimes work for me,
    sometimes it does not. It seems to be sort of flaky, and sometimes it just
    won't stop at the breakpoints. #1 is pretty reliable, but you have to
    remember to remove the debugger statements when you are done

    "ABC" <> wrote in message
    news:%...
    > How to debug client-side script (javascript) from VS2003 or VS2005?
    >
    >
     
    Marina, Dec 29, 2005
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. vaidas gudas
    Replies:
    1
    Views:
    369
    Franco Figún
    Jul 13, 2004
  2. vaidas gudas
    Replies:
    4
    Views:
    673
    Scott Allen
    Sep 29, 2004
  3. Magnus Blomberg
    Replies:
    3
    Views:
    734
    Magnus Blomberg
    Apr 14, 2005
  4. Boss302
    Replies:
    0
    Views:
    1,084
    Boss302
    Nov 21, 2006
  5. V&G
    Replies:
    2
    Views:
    346
    Cowboy \(Gregory A. Beamer\)
    Oct 18, 2006
Loading...

Share This Page