Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old November 23rd, 2015, 02:36 PM
Friend of Wrox
Points: 2,702, Level: 21
Points: 2,702, Level: 21 Points: 2,702, Level: 21 Points: 2,702, Level: 21
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Denver, CO, USA.
Posts: 425
Thanks: 57
Thanked 2 Times in 2 Posts
Default Unable to debug JS in VS IDE

I've run into some bizarre problem debugging JS; on a random basis the VS IDE refuses to recognize breakpoints. This is apparently a known bug MS has promised to eventually fix, but this won't wait for them to get around to it. Others have suggested adding a "debugger;" statement, but like breakpoints, this also only works sometimes; VS asks which version of VS I want to open (2008, 2010 and 2012 are all installed), but the script is sometimes not displayed. Clicking on the documents listed in Solution Explorer appears to do nothing. That's clearly no help debugging!

But when VS hits some JS errors, it opens a different dialog box asking if I wish to use the built-in script debugger in IE. When I answer yes, the script is displayed in the F12 Developer Tools debugger and I can step through it as expected. I could obviously force an error to invoke the F12 tool, but that's as clunky as adding a "debugger" statement and may mask the real problem.

And inserting "alerts" before every statement to trace it (like the dark ages before interactive debuggers) doesn't help when the script refuses to run at all!

Has anybody else also experienced this? Is there some setting that would redirect VS to the F12 tool when it hits the debugger statement instead of opening an empty instance of VS? If there is no way to do that, what do I have to do to get the script to actually appear when it hits this "debugger" statement?

How do I debug this script?
Reply With Quote
  #2 (permalink)  
Old November 23rd, 2015, 04:45 PM
Imar's Avatar
Wrox Author
Points: 71,164, Level: 100
Points: 71,164, Level: 100 Points: 71,164, Level: 100 Points: 71,164, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 16,948
Thanks: 79
Thanked 1,555 Times in 1,532 Posts
Default

Maybe this is obvious and not what you're looking for, but what about not using integrated script debugging in VS but also use F12 tools? That's how I typically do it using Firebug in Firefox.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
  #3 (permalink)  
Old November 24th, 2015, 10:44 AM
Friend of Wrox
Points: 2,702, Level: 21
Points: 2,702, Level: 21 Points: 2,702, Level: 21 Points: 2,702, Level: 21
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Denver, CO, USA.
Posts: 425
Thanks: 57
Thanked 2 Times in 2 Posts
Default

Any consistent approach would help! Is there a site you can direct me to that explains how to do this?
Reply With Quote
  #4 (permalink)  
Old November 27th, 2015, 02:51 PM
Imar's Avatar
Wrox Author
Points: 71,164, Level: 100
Points: 71,164, Level: 100 Points: 71,164, Level: 100 Points: 71,164, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 16,948
Thanks: 79
Thanked 1,555 Times in 1,532 Posts
Default

Just read the top 10 articles from this page: https://www.google.com/?gws_rd=ssl#q...g+with+firebug

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Ch. 18 - p.684 - Unable to debug JavaScript in IE Tulsi BOOK: Beginning ASP.NET 4 : in C# and VB 2 May 23rd, 2013 01:15 PM
Unable to remote debug Ron Howerton .NET 4 and Visual Studio 2010 General Discussions 0 March 3rd, 2011 04:24 PM
debug mode , VS-IDE becomes close AbrarNazeer ASP.NET 2.0 Professional 0 June 28th, 2006 06:49 AM
Unable to debug ASP.Net project... muskaanbajaj ASP.NET 1.0 and 1.1 Professional 0 December 3rd, 2005 12:24 AM
Created New Project now get Unable to Debug messag GottliebPins ASP.NET 1.0 and 1.1 Basics 5 April 2nd, 2004 06:21 PM



All times are GMT -4. The time now is 01:14 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.