问题描述
有没有简单的方法,使我们可以知道在哪个方法被调用运行系统中的顺序?
Is there any easy way in which we can know the sequence in which methods are called in runtime?
例如:在我的JS文件,我有大约15的方法。有一些异步调用。随着异步调用,我们永远不知道它们被称为和执行顺序。所以:我想知道,如果有一种方法,使我们可以进行调试(使用的开发工具,IE \\铬\\ FF)..任何工具,它告诉我它的异步调用被称为第一,它们被调用的顺序。
Example: In my JS File, I have around 15 methods. There are some Asynchronous calls. With Async calls we never know the sequence in which they are called and executed. So : I want to know, if there is a way in which we can debug (using developer tools, IE\Chrome\FF) .. any tool which tells me which async call was called first and the order in which they are called.
感谢。
推荐答案
使用Chrome开发者工具,您可以使用源面板调试JavaScript。
Using Chrome developer tools, you can use the Sources panel to debug javascript.
在右侧,你可以为不同类型的事件,包括XHR断点添加断点。
On the right side, you can add breakpoints for various types of events including XHR Breakpoints.
当触发断点执行将停止,您可以通过执行流程步骤。
The execution will stop when the breakpoint is triggered and you can step through the execution flow.
我是pretty确保Firefox和IE浏览器也有类似的工具。
I'm pretty sure Firefox and IE have similar tools.
这篇关于调试JS文件 - 客户端code的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!