Load JQuery into any page using Firebug

久未见 提交于 2019-12-05 12:05:50

问题


Does anyone have a snippet to load jquery onto any page from firebug? I often come across sites that I would prefer to inspect using familiar jq syntax.

For example, say I want to extract a list of prices from a page - it would be nice to launch firebug, install jquery from the google CDN, and type $('li.prices').each(...).


回答1:


Just saw this bookmarklet for injecting jQuery in another thread




回答2:


Another way is to paste this to the Firebug console and hit the execute button.

var fileref = document.createElement("script");
fileref.setAttribute("type", "text/javascript");
fileref.setAttribute("src", "http://code.jquery.com/jquery-latest.min.js");
document.head.appendChild(fileref);

UPDATE: Use following snippet to inject jQuery into a website that uses HTTPS:

var fileref = document.createElement("script");
fileref.setAttribute("type", "text/javascript");
fileref.setAttribute("src", "https://code.jquery.com/jquery-latest.min.js");
document.head.appendChild(fileref);



回答3:


Check out FireQuery




回答4:


You can also use the include function from the Console with either the URL to jQuery or by using the predefined alias, like this:

include("jquery")

See here for more detail.




回答5:


check out jQuerify



来源:https://stackoverflow.com/questions/1853692/load-jquery-into-any-page-using-firebug

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!