jquery - Greasemonkey 和 jQuery 1.4.2 不工作

标签 jquery greasemonkey

我正在尝试使用 Greasemonkey 和 jQuery 1.4.2。当我安装 Greasemonkey 脚本时,jQuery 肯定会被下载并出现在脚本目录中。但是,下面的代码不会向 PAPAGETITLE 类的元素附加任何内容。我做错了什么?

// ==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.");

最佳答案

更新:

从 Greasemonkey 版本 0.9.1 开始,jQuery 1.5.1 似乎在我迄今为止的所有脚本和测试中都运行良好。

<小时/>

如果没有一些黑客攻击,Greasemonkey 无法与 jQuery 1.4 一起工作。

使用 jQuery 1.3.2。

参见:http://forum.jquery.com/topic/importing-jquery-1-4-1-into-greasemonkey-scripts-generates-an-error (和其他)。

关于jquery - Greasemonkey 和 jQuery 1.4.2 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3207199/

相关文章:

javascript - :not + :contains, 的 jQuery 组合可以工作吗?

javascript - 使用 Greasemonkey 每 5 秒执行一次 Javascript?

javascript - 在具有多个 id 的目标页面上,脚本仅作用于第一个

google-chrome - 在 Chrome 中通过用户脚本替换页面功能?

jquery - 如何获取div元素的title属性?

php - 如何在 Wordpress 上获取菜单数据

jquery - 钻取内的堆叠列 - HighCharts

php - 使用 php jquery ajax 从 mysql 获取图像并将它们显示在 DIV 内的 html 页面中

php - 提交表单后刷新表单页面?

regex - 在 Greasemonkey @include 中使用正则表达式?