在ASP.NET中调试JavaScript

New*_*Net 11 javascript asp.net debugging

我需要调试我用asp.net编写的javascript函数.

我目前正在使用chrome,但它没有进入断点.如果我放alert('Some message').我可以看到显示的消息.

如果有人知道如何在ASP.NET中使用JavaScript调试器,请告诉我.

Adi*_*dil 9

要在chrome中调试,您需要做两件事

  1. 将调试器写入要开始调试的位置.
  2. 在执行脚本打开开发人员工具之前(通过按ctrl + shift + i)

现在当控制执行到您编写调试器的语句时,执行暂停,以便您进行调试.

以下是您学习的示例,请按照评论中的说明进行操作.如何在chrome中调试


Nud*_*ena 9

尝试使用Internet Explorer调试代码,您可以这样做,将调试器关键字放在要调试的代码之前.

   <script type="text/javascript">
    function s() {
   //enable the debugger feature.
        debugger;
        var alert = "this is a debugger test";
        alert(alert);
    }
   </script>
Run Code Online (Sandbox Code Playgroud)