简体   繁体   English

使用Just My Code在Visual Studio 2013中调试Javascript

[英]Debug Javascript in Visual Studio 2013 with Just My Code

I enabled Just My Code in Visual Studio 2013 but I cannot hit a breakpoint in my javascript code let alone not stepping into an external javascript library eg jQuery. 我在Visual Studio 2013中启用了Just My Code ,但是我无法在我的javascript代码中遇到断点,更不用说不进入外部javascript库(例如jQuery)了。 I can hit using debugger keyword and unchecking disabling script debugging from Internet Explorer though. 我可以使用debugger关键字,然后取消选中从Internet Explorer禁用脚本调试的功能。 I think MS has introduced such a great feature but it is useless if I cannot use it with ASP.NET. 我认为MS已经引入了如此出色的功能,但是如果我不能在ASP.NET中使用它,那就没用了。
Someone please suggest anything. 有人请提出任何建议。

You need to read the documentation in this URL. 您需要阅读此URL中的文档。 It tells you all about how VS determines if the code is your code or not, and how to tell VS what is your code and not. 它告诉您有关VS如何确定代码是否是您的代码以及如何告诉VS您的代码是不是的所有信息。 Be sure to skip down to the JS section. 确保跳到JS部分。

http://msdn.microsoft.com/en-us/library/dn457346.aspx#BKMK_JavaScript_Just_My_Code http://msdn.microsoft.com/en-us/library/dn457346.aspx#BKMK_JavaScript_Just_My_Code

You can use Firefox and use Firebug plugin to debug your javascript. 您可以使用Firefox并使用Firebug插件来调试JavaScript。

Also check Just My Code for JavaScript Windows Store Apps in Visual Studio 2013 还要检查Visual Studio 2013中JavaScript Windows Store应用程序的Just My Code

The inconsistency of JS breaking in VS is a pain. VS中JS中断的不一致是一个痛苦。 If I am in a hurry I simply insert an errorable statement (eg., sdfasdf;) at the spot in the JS where I want to look at the variables. 如果我很着急,我只需在要查看变量的JS位置插入一个错误的语句(例如sdfasdf;)。 This causes an alert window to pop up. 这将导致弹出警报窗口。 Click the 'Break' button and you will be at the line that caused the error. 单击“中断”按钮,您将位于引起错误的行。 At that point all of your variables will be visible. 届时,所有变量都将可见。 You can then drag the yellow current line indicator to a line of your choosing and continue processing from there. 然后,您可以将黄色的当前行指示器拖到您选择的行上,然后从那里继续进行处理。 This has worked for me since VS 2005. 自VS 2005起,这对我一直有效。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM