在ASP.NET中调试JavaScript [英] Debugging JavaScript in ASP.NET

查看:84
本文介绍了在ASP.NET中调试JavaScript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友,
谁能告诉我,如何调试JavaScript.我正在使用VS 2008、3.5框架.
我尝试提供断点,但是在运行时javascript代码没有得到调试.

在此先感谢

Hello friends,
Can anyone tell me, how can one debug javascript. I''m using VS 2008, 3.5 framework.
I tried by giving breakpoint, but in runtime javascript code is not getting debug.

Thanks in advance

推荐答案

启用JavaScript调试

转到浏览器

工具-Internetoptions-高级

之后,取消选中
To enable javascript debugging

goto browser

Tools-Internetoptions-advanced

After that uncheck
Disable script debugging(Internet explorer)



然后Apply-ok



then Apply-ok


确保已在浏览器中启用了javasctipt调试. (对于IE,Internet选项->高级)

完成此操作后,您应该能够在Javascript文件中放置断点.
万一您仍然遇到问题,但是在javascript方法中使用关键字"debugger".执行该方法时,它将在那里停止.

尝试!
Make sure you have enabled javasctipt debugging in your browser. (For IE, Internet options -> Advanced)

Once you do that, you should be able to put breakpoints in the Javascript files.
In case, you are still facing issues, but keyword ''debugger'' in the javascript method. When the method is executed, it will stop there.

Try!


当Javscript在您的浏览器IMO中运行时,仅使用内置的浏览器调试功能而不是费力地使其与VS配合使用就更简单了.

对于Firefox,您可以安装"Firebug".安装后,您应该在右下角看到一个小错误图标.您可以单击它,它将在底部打开一个窗格,单击脚本"(您可能需要先启用它).

对于Chrome,开发人员工具是标准安装的:扳手>工具>开发者工具.这将在页面底部打开一个框架.单击脚本"选项卡,它应该显示脚本.

这两个选项都非常好,为您提供了调试器所期望的所有常用功能(监视表达式调用堆栈等).

我相信IE的最新版本也内置了类似的功能,但是我没有使用它们的经验.
As Javscript runs in your browser IMO it''s simpler to just use the built in browser debugging capabilities rather than fiddle with getting it to work with VS.

For Firefox you can install ''Firebug''. After installing it you should see a little bug icon in the bottom right. You can click on that and it will open up a pane at the bottom, click on ''Script'' (you may need to enable it first).

For Chrome, developer tools come installed standard: Wrench > Tools > Developer Tools. This will open a frame at the bottom of the page. Click on the ''Scripts'' tab and it should show the scripts.

Both these options are pretty good giving you all the usual features you would expect from a debugger (watch expressions call stacks etc).

I believe the latest versions of IE also have similar capabilities built in but I do not have experience with them.


这篇关于在ASP.NET中调试JavaScript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆