Javascript - 调试 - 跟踪 [英] Javascript - Debugging - Trace

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

问题描述

我正在使用VS2010 Express。我正在使用javascript函数。它在计时器上,大部分时间都在工作,然后突然停止。我需要找出它停止的地方。我不能使用断点,因为它在大多数时间都有效。


我想在输出文件夹中写一条消息,这样我就能看到在程序中访问过的内容。


例如

 

function < span class ="typ"> Myfunction () {
console
write "已达到A点" );

....有些东西......

console write "已达到B点" );

};

解决方案

功能 <跨度> <跨度> <跨度> myFunction的 <跨度> <跨度>() <跨度> <跨度> {  

   警报
"已到达A点" );


.... 一些东西 ...


  警告 " B点已达到" );


}; <跨度> <跨度>


I am using VS2010 Express. I am wrting a javascript function. It is on a timer, and works most of the time, then suddenly it stops. I need to work out where it stops. I cannot use break points, as it works most of the time.

I want to write a message to the output folder so I can see what was accessed during the program.

eg

function Myfunction() { console.write("point A has been reached");

....some stuff...

console.write("point B has been reached");

};

解决方案

functionMyfunction(){ 
    alert
("point A has been reached");

....some stuff...

 alert("point B has been reached");

};


这篇关于Javascript - 调试 - 跟踪的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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