JavaScript debugging in VS2008 - javascript

I'm having a real problem trying to attach the JavaScript debugger in VS2008 to a web project. The web app is an ASP.NET MVC project but I don't think that should matter.
I'm using jQuery and have a .js file loaded when the page loads and in this .js file I call $(document).ready(function() { ... } and do some stuff and this "works." When I set a breakpoint it becomes disabled when I run the project through Cassini with the message "The breakpoint will not currently be hit. No symbols have been loaded for this document."
This error message is somewhat confusing because this is a javascript file so I would expect it to have a symbols file that could be loaded. i.e. a .pdb file that you would need to debug server side code. Or am I missing something here?
I found this post here:
Using breakpoints to debug Javascript in IE and VS2008
but that didn't help.
I've also tried a few other recommendations which involved attaching the browser from the debug menu after starting the debug session and I've tried doing this on IE x86, IE x64, and Firefox. If I add "debugger;" to my code then it will break in Firefox and let me step through the code in the Firefox debugger but I can't get it to do this in VS2008.
I'm running Win7 x64 Ultimate with VS2008 and the project is ASP.NET MVC with jQuery.
Any ideas?

have you tried debug the js file alone(put a debugger in code) by adding it to a blank html page?? and check whether it ll throw a script breakpoint exception and allow you to attach to VS 2008??

Have you checked the "enable script debugging" option under tools (not sure what it's called, on a Mac right now) in IE?

Related

How to view Visual Studio 2015 Javascript Console after debugging mode stops?

My Javascript Apache Cordova app builds fine but doesn't behave debugging on the emulator or real device.
I see a bunch of messages rush by in the Visual Studio Javascript Console but the app then immediately crashes and the Javascript Console becomes unavailable.
I've tried setting breakpoints to pause the app which doesn't work.
How can I view these Javascript Console logs after the debugger stops ?
EDIT: this if for Windows Phone (Universal) with plugins for Windows Phone and not debuggable in the browser
this is the only way i've figured ;
Ensure JS console button "Clear on navigate" is not set
Start the app so that the errors appear albeit momentarily
Remove plugins and associated code one by one until your app doesn't crash
View original error messages in the JS console from previous sessions
This doesn't answer your question but it may help to check the exception settings via:
Debug -> Windows -> Exception Settings
They determine whether or not the debugger will break when exceptions are thrown.

Hiding Script Errors popups in IE8

I have inherited an application that download a js code from another place and with the help of the
IWebBrowser2 interface in Windows it runs this js in that browser inside a hWindow.
While i run the app on the machines with IE9 and IE10 no popups with script errors. When i run the app in a machine with IE8 i can see a script error message appears. I tried to disable the script errors inside the Internet options advanced tab and also cleared the Enable 3-party browser extensions.
Those didn't help to suppress the script Error. Perhaps, someone knows how i can get rid of the script error in IE8.

How to debug (only) JavaScript in Visual Studio?

I'm developing a webapplication (asp.net mvc 4) with Microsoft Visual Studio 2012, and as the solution is getting bigger, the debug is getting slower.
Need to know if there is a way to debug only my client side (javascript) on visual studio instead of the entire application (server+client).
Is there any way to attach to process of IE and get the breakpoints working ....?
Not interested on get the debugger running on entire client/server application, just client.
First open Visual studio ..select your project in solution explorer..Right click and choose option "browse with" then set IE as default browser.
Now open IE ..go to
Tools >> Internet option >> Advance>> uncheck the checkbox having "Disable Script Debugging (Internet Explorer). and then click Apply and OK and you are done ..
Now you can set breakpoints in your JS file and then hit the debug button in VS..
EDIT:- For asp.net web application right click on the page which is your startup page(say default.aspx) and perform the same steps. :)
Yes you can put the break-point on client side page in Visual studio
First Put the debugger in java-script code and run the page in browser
debugger
After that open your page in browser and view the inspect element you see the following view
The debugger should automatically attach to the browser with Visual Studio 2012. You can use the debugger keyword to halt at a certain point in the application or use the breakpoints directly inside VS.
You can also detatch the default debugger in Visual Studio and use the Developer Tools which come pre loaded with Internet Explorer or FireBug etc.
To do this goto Visual Studio -> Debug -> Detatch All and then click Start debugging in Internet Explorer. You can then set breakpoints at this level.
For debugging JavaScript code in VS2015, there is no need for
Enabling script debugging in IE Options -> Advanced tab
Writing debugger statement in JavaScript code
Attaching IE didn't work, but here is a workaround.
Select IE
and press F5. This will attach both worker process and IE as shown here-
If you are not interested in debugging server code, detach it from Processes window.
You will still face the slowness when you press F5 and all your server code compiles and loads up in VS. Note that you can detach and attach again the IE instance launched from VS. JavaScript breakpoints are hit the same way they are in server side code.
It is possible to debug by writing key word "debugger" to place where you want to debug and just press F5 key to debug JavaScript code.
http://www.aspsnippets.com/Articles/Debug-JavaScript-and-jQuery-using-Visual-Studio-in-Internet-Explorer-browser.aspx
This is what worked for me:
Add a new browser with to ie x86 version
2- On the Start Options of the Property Pages select the Start Option as:
Don't open a page. Wait for a request from an external application
3- Open the application from internet explorer
4- In the attach to Process screen select the following code types:
Javascript (Microsoft edge - chromium) and Script
5 - In the available process list select:
iexplorer.exe x86

javascript running locally but not on apache

I'm using JSValidate to validate a form, the form gets validated correctly when I access it via File-> Open File, but not when I type localhost/formname on my address bar.
When ran from localhost/formname the form behaves as if the Javascript weren't there. This doesn't happen in my apache server at home, yet it does happen at work. What could it be?
*both machines run ubuntu's firefox, with javascript enabled.
Full code
Get Firebug, Web Developer Toolbar and possibly ConsoleĀ².
That are Firefox add-ons which can aid you in debugging.
Take a look in your Error Console, search for errors.
Do you have the "scriptaculous" folder in the same folder?

Javascript debugger issue in VS2008

I'm having a really annoying problem with debugging javascript with VS2008.
If I simply press F5 (or choose 'start Debugging' from the Debug menu), the iexplore process is attached, but no breakpoints break in the scripts. The Script Documents tree doesn't even appear in the solution explorer.
I already know:
I can set a breakpoint in Javascript just fine. It does NOT show the "This point will not be hit" message.
Calling the debugger through using the 'debugger' keyword works fine, but attaching to the iexplore process doesn't since it gives a "process already attached to a debugger" message.
Using the manual 'Attach to process...' works just fine. The Script Documents appears as well.
The project has recently been converted to a Web Application from a WebSite.
I already tried:
Clearing the IE cache.
Shutting down VS2008, Stopping the IIS and deleting the temporary asp.NET files restarting both IIS and VS2008 afterwards.
Setting IE7 as the default browser both for windows and for VS2008.
Resetting my user settings for VS2008.
Checking that IE script debugging is enabled.
Nothing has worked so far. While Attaching to process isn't too taxing, it is very annoying when I'm used to just hitting F5.
If anyone can think of a solution, please please please (I'm begging here!) let me know!
Is silverlight debugging enabled on the website project properties? This will disable Javascript debugging.

Categories

Resources