客户端调试

扫码查看
本文介绍了客户端调试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有时我在浏览器中遇到异常,我被提示启动

Visual Studio 2005进行调试。

有时我想按需启动客户端调试。我怎么能这样做?
那样做?

-

Arne Garvander

(为了好玩我编程VB.Net和C#获得报酬。)

Sometimes I get an exception in the browser and I get prompted to start
Visual Studio 2005 for debugging.
Sometimes I would like to start client side debugging on demand. How can I
do that?
--
Arne Garvander
(I program VB.Net for fun and C# to get paid.)

推荐答案






大概,你的意思是在IE中调试Javascript ......?


如果是这样,以下几乎可以保证工作:


1)下载并安装Microsoft脚本调试器



2)在IE中,单击工具,Internet选项并选择高级选项卡,然后确保禁用脚本调试(*)
未检查Internet Explorer)


3)在客户端Javascript中,插入调试器;你想要的地方

你的代码要打破。例如


< script>


函数myFunction()

{

调试器; //代码执行将在这里打破

alert(''Hello world'');

}


4)点击F5开始你的应用程序。当您导航到相关页面时,

您可以调试客户端Javascript,就像调试

服务器端代码一样,即使用F10,F11等,询问当地人,使用

立即窗口等...



Presumably, you mean debugging Javascript in IE...?

If so, the following is pretty much guaranteed to work:

1) Download and install the Microsoft Script Debugger
http://www.microsoft.com/downloads/d...DisplayLang=en

2) In IE, click Tools, Internet Options and select the Advanced tab and make
sure Disable Script Debugging (Internet Explorer) is NOT checked

3) In your client-side Javascript, insert the word debugger; where you want
your code to break. E.g.

<script>

function myFunction()
{
debugger; // code execution will break here
alert(''Hello world'');
}

4) Click F5 to start your app. When you navigate to the page in question,
you can debug your client-side Javascript just like you would debug your
server-side code i.e. with F10, F11 etc, interrogate locals, use the
Immediate window etc...





这篇关于客户端调试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-28 05:29
查看更多