![]() ![]() |
i'm using Firefox 2.0.0.11 and Greasemonkey 0.8.x and the latest jQuery (1.3.2) version that works with Greasemonkey 0.8 (??) and try to load this Userscript:
// ==UserScript==
// @name TEST
// @include *
// @require jquery.min.js
// @grant GM_getValue
// ==/UserScript==
$(document).ready(function(){
alert('jQuery!');
});
but i recieve the error: Error: $ is not defined Source File: file:///G:/Firefox/Data/profile/gm_scripts/huhu/huhu.user.js Line: 8 I want to load jQuery on a local pc with no internet connection.
<###script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script###> I have copied jquery.min.js in the same folder where the userscript is. G:/Firefox/Data/profile/gm_scripts/huhu/jquery.min.js any ideas where is the problem? or what i've done wrong? regards bernte |
![]() ![]() |
Hi,
My solution is to paste the whole jquery-code into the script first of all (after header / or proceeding the code which needs it) and it works fine. Mind you - I don't use auto-updating of scripts so they don't get corrupted, likewise I check on updates if the required file is still the same. greets Vivre |
![]() ![]() |
You need to install the script (drag and drop onto the browser window) with valid require path, like this: // ==UserScript==
// @name TEST
// @include *
// @require file:///c:/jquery.min.js
// @grant GM_getValue
// ==/UserScript==
$(document).ready(function(){
alert('jQuery!');
});
Before installing make sure you have jquery.min.js on disk C:\
Note2: I'm not sure if GM allows to use file:/// as require - personally I use Scriptish, which works with newer versions of jQuery. |
![]() ![]() |
@AmpileDude wrote: @require from file:// source should not work. But simply you put two files in a folder.
|
![]() ![]() |
// ==UserScript==
// @name TEST
// @include *
// @require jquery.min.js
// @grant GM_getValue
// ==/UserScript==
$(document).ready(function(){
alert('jQuery!');
});
does not work... i have dropped this script into firefox.. and i get a errormessage (can't install) then i removed require path and installed it.
thanks for your help |
![]() ![]() |
Editing the header of the already installed file doesn't help, as this info is only read once by GM on installation.
Find your Script filename="... and add a require line to it. The required js-file should be placed in the folder where the specific script is. Be carefull when doing this and maybe make a complete save-copy of /gm_scripts first. |
![]() ![]() |
I can install. GM Version 1.0 |


