Trying to load jquery into tampermonkey script
You need to have a @require
in the user script header to load jQuery. Something like:
// @require http://code.jquery.com/jquery-3.4.1.min.js
(Selecting your desired version from the of list of available versions of jQuery)
For future googlers,
If you have used the above method and still jQuery doesn't seem to be loaded by your script try looking at the spaces, And try to match the indentation with the rest of the header. Apparently the indentation is important.
Faulty:
// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://stackoverflow.com/*
// @require http://code.jquery.com/jquery-3.4.1.min.js
// @grant none
// ==/UserScript==
Correct:
// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://stackoverflow.com/*
// @require http://code.jquery.com/jquery-3.4.1.min.js
// @grant none
// ==/UserScript==