Why is $ undefined when I try to use jQuery in GreaseMonkey?
- by Natrium
I'm totally new to GreaseMonkey, but I'm trying to make a little script.
// ==UserScript==
// @require http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js
// ==/UserScript==
(function() {
$ = unsafeWindow.jQuery;
alert($); // this gives 'undefined'
}());
Why does the alert give undefined and how to fix this?