I remember seeing that there was a specific command you could put on Google Chrome's inspector console for it to load jQuery and allow you to execute jQuery commands.
However, I cannot remember which command it was, and searching online only brings me unrelated results.
Anyone knows which is that command?
Thanks!
EDIT: Years later I had realized that I was asking for the $$
function in the console. However, this is not jQuery but provides a similar selector option, most likely a shorthand for document.querySelectorAll
. The answers here address adding jQuery for real, with all of its functionality.
You mean, a script to load jQuery in an arbitrary page? I have constructed the following cross-browser bookmarklet for this purpose:
It detects whether jQuery exists. If it does, a confirmation dialog appears, in which the current version is shown, so that you can decide whether it's OK to overwtite the existing jQuery object.
Currently, jQuery 1.8 is loaded from a CDN over SSL.
'1.8'
with e.g.'1.7.1'
.jquery.js
withjquery.min.js
.http:
, Google's CDN can be replaced with:To save you time from editing, here's the same bookmarklet as the top of the answer, but getting the latest version (instead of a fixed one) from
http://code.jquery.com/
:Note: Having the latest version is nice, but don't be surprised when jQuery "behaves weird" (=updated).
You can also create a chrome snippet which load jQuery on chrome inspector ( how create custom snippets )
Snippet code: