Numinous Productions Website and Graphic Design

Unless a website your working on has already loaded jQuery, this tried and tested resource won't be available to you inside your console unless you can pull it in. 

You could write a little snippet of javascript that appends the jQuery CDN script tag to the top of the page:

var jQueryScript = document.createElement('script'); jQueryScript.setAttribute('src','https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js'); document.head.appendChild(jQueryScript);

Source: https://stackoverflow.com/questions/43796705/how-to-include-cdn-in-javascript-file-js

This does the trick. But you'll need to include this code each time you refresh the page.

While looking for the solution to a separate problem, I stumbled onto this awesome little thread (originally posted by jondavidjohn): https://stackoverflow.com/questions/7474354/include-jquery-in-the-javascript-console

Essentially, once you've created your custom bookmarklet, you can "Turn On" jQuery with a click and start writing out jQuery scripts to your hearts content in your console. No copying and pasting a block of code.

1. Create a new bookmark.
2. In the bookmark URL, enter:

javascript:(function(e,s){e.src=s;e.onload=function(){jQuery.noConflict();console.log('jQuery injected')};document.head.appendChild(e);})(document.createElement('script'),'//code.jquery.com/jquery-latest.min.js')

3. Save your new bookmark.

Next time you need to use jQuery, click your new bookmark, open your console, and start writing jQuery.

You can replace "code.jquery.com/jquery-latest.min.js: with your own specific CDN URL if there's an older version of jQuery you prefer.

 

empty
empty
empty
empty
empty
empty

Numinous Productioncircle icon 356 37th Street SW, Barberton, OH 44203circle icon740-438-8851circle iconryan@numinousmedia.com