There is a class library project with embedded javascript file, with a lot of functions (clint-side implementation), is it possible to debug them?
If I set breakpoints inside this file, they never break.
You can, but there is some setup involved - there's an explanation here:
http://weblogs.asp.net/scottgu/archive/2007/07/19/vs-2008-javascript-debugging.aspx
Once set up it works pretty much the same way you'd debug server-side code.
Edit: I should add that it depends what you're doing as to where is the best place to do your debugging. If you're strictly doing client side debugging then I'd suggest using Firebug etc as suggested by the other answers, if you're moving between client and server side code then it's less clumsy to use the Visual Studio tools as above.
You need to debug javascript client side with something like Firefox/Firebug, FirebugLite, or IE8 Developer tools.
Debugging JavaScript has to be done via the client. Breakpoints in the back end would never be triggered because the back end never actually runs the code.
The method for debugging JavaScript varies by browser. For Internet Explorer, there is an Internet Developer toolbar and a Script Editor that will help. For Firefox, tools such as the FireBug addon are very helpful.
Related
Is there any way to access webkit JavaScript and HTTP errors that happen when capturing a page with CutyCapt? I'm trying to debug a thumbnail capture for JavaScript generated documents.
This is not currently possible. I would recommend using a tool like Wireshark to debug any HTTP errors that might occur. It would be easy to add tracing code for network replies to CutyCapt and there are some patches on SourceForge and/or GitHub that do that. I am not sure what could be done to trace JavaScript errors, but ordinarily there should not be any that do not also occur when a page is loaded in a browser. Qt comes with a sample application that implements a rudimentary web browser that could be used for this purpose. I think it also comes with the standard debugger, but I might be misremembering that.
I'm learning how to use Meteor and am coming from some basic/intermediate python/django knowledge.
What's the best debugging tool in Meteor, perhaps one that can let you pause the code in the middle of execution and let you walk through? I'm thinking something like ipdb in python...
On the client, use your browser's developer tools to set breakpoints and step through code.
On the server, since Meteor runs on node.js, you could use node-inspector, which hooks into your browser's developer tools. See Meteor: Debug on server-side for more info on how to get node-inspector working.
I have a simple asp.net website.
In JavaScript, I added a handler to the window.onerror event.
When I debug in Visual Studio, their handler seems to override mine. When any JavaScript error occurs, it enters their debugger and my onerror function never gets called.
Is there anything I can do to make mine still operate without disabling client side debugging?
I am afraid that client script debugging in Visual Studio is all or nothing. VS hooks JScript in the IE that is launched on debug there are no configurable options in how it handles js errors.
I completely understand your question and why this is a big deal. The only real option for testing your client side error handling is to use venkman, jetbrains (they have a new web centric ide) or some other js debugger.
Not telling you anything you don't already know, just confirming it. ;-)
Let me know how you eventually decide to handle this.
The awesome tool Web Development Helper allows me to see ALL the http requests from the browser (IE6/IE7) to the server. However the tool does not seem to work in IE8-RC1.
Does IE8 developer tools have a similar feature built in?
If yes, how do I access it?
TIA
rams
My preference is Fiddler, it works with all browsers I know of.
In order to debug an asp.net web app I have to have IE Script debugging enabled. Unfortunately, in the past week or so google's analytics javascript has developed a problem. So that when I browse to a site that has google analytics I receive the little pop up "A runtime error has occurred. Do you wish to debug?"
Yes, even stackoverflow is affected.
This is a tremendous pain in the butt. Is there any way to keep IE Script debugging enabled to keep the .net debugger happy, but get rid of the pop up?
I would suggest using IE for debugging purposes only, and Firefox for darn near everything else. Your life will benefit from this.
Script Debugging is not required to debug ASP.NET pages, it is only required if you wish to stepthrough script errors, you can disable this option in IE and still debug your server code fine. Unfortunately it is an IE wide option so if it's on it's on and if it's off it's off.
But disabling the option will not prevent you from debugging your asp.net applications.
Are you debugging javascript behaviour specifically in IE? If not, get Firefox and Firebug. Javascript debugging in IE is painful, and should only be resorted to in situations where you're trying to fix IE idiosyncrasies. You don't need script debugging enabled in IE if you're just debugging web forms.
You could write some code to make a change to the following key in the Registry
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\Disable Script Debugger
Depending on how you have your project you might be able to tie it to the actual build (via a Macro), or if anything just put it somewhere in your Application_Start event.
Returning back to normal might be a little more difficult. Potentially you could watch for the iexplore.exe process and when it dies you revert it back.
Hope that helps.