How to find out the piece of code that initiated ajax request

后端 未结 2 603
走了就别回头了
走了就别回头了 2021-02-07 12:03

I have MVC view, in that tens of javascript files are included. there are some ajax requests initiated from the page. I would like to know from which particular js file the call

2条回答
  •  南方客
    南方客 (楼主)
    2021-02-07 12:38

    I've been finding some of Chromes more recent debugging features very useful. Bring up the inspector(Ctrl+Shift+I) and switch to the Network tab before launching your application or performing the actions in question. Each http request will show the origin of the request in the Initiator column. If javascript initiated the request, it will show you the filename and line number with a clickable link to go straight to it.

提交回复
热议问题