I'm learning more about jQuery and would like to use it interactively at the JavaScript console in Chrome. Is that possible? I envision something like this, but it doesn't work:
> use('jquery.js')
jquery loaded
> $("span").html("Hello World!")
This would cause "Hello World!"
to be inserted between the span tags and displayed.
There is no "use" so of course it will not work.
You can append it to a page.
var scr = document.createElement("script");
scr.src = "http://code.jquery.com/jquery-1.9.1.min.js";
document.body.appendChild(scr);
If you have jQuery included in the page that you have the console open on you should be free to use it in the console.
The simpliest way to do this, is to edit the header of the page and add a <script>
tag pointing to jQuery.
Then you will be able to execute the code in your console.
Never mind. Figured it out :-) I created a simple HTML file that loaded jQuery and then went into the console. This works for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With