How to find where a .js library is loaded ("imported")

时间:2017-06-20 12:37:27

标签: javascript

I've got a .js file (main.js) that uses SetCookie() from cookies.js

But I can't see where cookies.js is ever loaded or "imported". It's not listed in the main.js, it's not listed in the page. It's not listed in any of the Included .js files.

How could I find where it's loaded?

1 个答案:

答案 0 :(得分:0)

使用浏览器,您可以看到您在页面上加载的资源的路径。

来自Firefox:

  • 按F12打开控制台
  • 选择“调试器”选项卡
  • 转到您的网站,您将看到所有已加载的JS,带路径。

Stack Overflow的截图:

enter image description here

根据文件的域/路径,您可能知道它是否是外部(或非)库,以及它来自何处。