November 20, 2013

How to add jquery to any webpage without using a browser plugin

Option 1
Copy the following code to your browser's javascript console (under developer tools) and run it:
var body = document.getElementsByTagName("body")[0];
var script = document.createElement('script');
script.type = "text/javascript";
script.src = "http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js";
body.appendChild(script);

Option 2
Go to: http://code.jquery.com/jquery-latest.min.js and copy the entire code to run in your javascript console.

To check, run the following in your javascript console:

$("body").length

And you should get 1.

No comments:

Post a Comment