浏览器console中加入jquery方便调试

chrome浏览器F12打开调试界面,在console中输入(firefox同样可以):

var jquery = document.createElement('script');  
jquery.src = "http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js";  //若调试页面是https的这里也修改为https.
document.getElementsByTagName('head')[0].appendChild(jquery);  
jQuery.noConflict();

  

这个节点就是我们动态生成的 script 节点.然后把百度上的jquery 地址赋给 jquery 节点.在 head 节点下插入jquery 节点即可.

 

回车,然后就可以使用jquery的选择器等很方便的操作调试了。

posted @ 2018-04-27 00:57  km ben  阅读(304)  评论(0编辑  收藏  举报