0%

一些网站无法用jquery调试

今天发现某网站在chrome的dev tool里面没法用jquery调试,原因未知。搜了下发现重新导入一下jquery就可以。

1
2
3
4
var importJs=document.createElement('script')  //在页面新建一个script标签
importJs.setAttribute("type","text/javascript") //给script标签增加type属性
importJs.setAttribute("src", 'https://code.jquery.com/jquery-3.3.1.min.js') //给script标签增加src属性, url地址为cdn公共库里的
document.getElementsByTagName("head")[0].appendChild(importJs) //把importJs标签添加在页面