Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 23rd, 2015, 03:36 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 428
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?
 
Old November 23rd, 2015, 05:45 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 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!
 
Old November 24th, 2015, 11:44 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 428
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?
 
Old November 27th, 2015, 03:51 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 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!





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 05: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 01:24 AM
Created New Project now get Unable to Debug messag GottliebPins ASP.NET 1.0 and 1.1 Basics 5 April 2nd, 2004 07:21 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.