Command for loading jQuery on Google Chrome inspector? -
i remember seeing there specific command put on google chrome's inspector console load jquery , allow execute jquery commands.
however, cannot remember command was, , searching online brings me unrelated results.
anyone knows command?
thanks!
edit: years later had realized asking $$
function in console. however, not jquery provides similar selector option, shorthand document.queryselectorall
. answers here address adding jquery real, of functionality.
you mean, script load jquery in arbitrary page? have constructed following cross-browser bookmarklet purpose:
javascript:if(!window.jquery||confirm('overwrite\x20current\x20version?\x20v'+jquery.fn.jquery))(function(d,s){s=d.createelement('script');s.src='https://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.js';(d.head||d.documentelement).appendchild(s)})(document);
it detects whether jquery exists. if does, confirmation dialog appears, in current version shown, can decide whether it's ok overwtite existing jquery object.
currently, jquery 1.8 loaded cdn on ssl.
- if want load different version, replace
'1.8'
e.g.'1.7.1'
. - if want load compressed version, replace
jquery.js
jquery.min.js
. - if don't mind loading jquery on
http:
, google's cdn can replaced with:- http://code.jquery.com/jquery.js - latest version
- http://code.jquery.com/jquery-latest.js - latest version
- http://code.jquery.com/jquery-1.8.0.js - version 1.8
to save time editing, here's same bookmarklet top of answer, getting latest version (instead of fixed one) http://code.jquery.com/
:
javascript:if(!window.jquery||confirm('overwrite\x20current\x20version?\x20v'+jquery.fn.jquery))(function(d,s){s=d.createelement('script');s.src='http://code.jquery.com/jquery.js';(d.head||d.documentelement).appendchild(s)})(document);
note: having latest version nice, don't surprised when jquery "behaves weird" (=updated).
Comments
Post a Comment