Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Load JQuery into any page using Firebug

Tags:

jquery

firebug

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(...).

like image 419
Matt Avatar asked Dec 05 '09 22:12

Matt


2 Answers

Just saw this bookmarklet for injecting jQuery in another thread

like image 200
EMiller Avatar answered Oct 04 '22 16:10

EMiller


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);
like image 31
Humppakäräjät Avatar answered Oct 04 '22 15:10

Humppakäräjät