views:

44

answers:

2

I am attempting to use Greasemonkey and jQuery 1.4.2. When I install the Greasemonkey script jQuery is definitely downloaded and appears in the scripts directory. However the below code doesn't append anything to elements with the class PAPAGETITLE. What am I doing wrong?

// ==UserScript==
// @name           PS Timesheet
// @namespace      http://www.steelebit.com/gmscripts
// @description    Used to fix a terrible implementation
// @include        https://intranet.site.com/*
// @require        http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js
// ==/UserScript==

// Append some text to the element with id #someText using the jQuery library.
$(".PAPAGETITLE").append(" more text.");
+1  A: 

Greasemonkey does not work with jQuery 1.4 without some hacking.

Use Greasemonkey 1.3.2.

See: http://forum.jquery.com/topic/importing-jquery-1-4-1-into-greasemonkey-scripts-generates-an-error (and others).

Brock Adams
+1  A: 

I've blogged about another possible solution here, which works with jQuery 1.4.*

Erik Vold