我在Safari中使用NinjaKit(與Greasemonkey相同)。這些代碼都是這樣爲什麼Greasemonkey腳本不能使用這個jQuery插件?
// ==UserScript==
// @name demo
// @namespace http://dailymed.nlm.nih.gov/
// @include http://dailymed.nlm.nih.gov/dailymed/*
// @require http://code.jquery.com/jquery-1.11.0.min.js
// @require http://johannburkard.de/resources/Johann/jquery.highlight-4.closure.js
// ==/UserScript==
$(document).ready(function() {
document.title = 'Hello!' + document.title;
alert("ZaiJian");
$("body p").highlight(["a"]);
});
當我訪問this page,該alert
可以顯示良好,但.highlight
功能取決於jQuery.highlight
和jQuery
不起作用。它說:
TypeError: 'undefined' is not a function (evaluating 'c.toUpperCase()')
而我覺得很難調試此..有沒有人有想法呢?
我只針對Safari的NinjaKit,我看到NinjaKit列出的表格,但可能只是Chrome NinjaKit。 http://ss-o.net/safari/extension/NinjaKit.safariextz –