javascript - Why doesn't this Greasemonkey script work with this jQuery plugin? -
i'm using ninjakit in safari (same greasemonkey). codes this
// ==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"]); }); when visit this page, alert can displayed well, .highlight function depends on jquery.highlight , jquery doesn't work. says:
typeerror: 'undefined' not function (evaluating 'c.touppercase()') and find quite hard debug this.. have ideas it?
i believe ninjakit doesn't @require. here's example made, works in firefox/greasemonkey , not in safari/ninjakit:
// ==userscript== // @name debug // @include http://localhost/library.html // @require file:///users/#######/sites/hello_world.js // @require http://localhost/~#######/hello_world.js // either way // ==/userscript== alert('activated'); hello_world(); # hello_world.js function hello_world(){ alert('hello world!'); } either "remote" address or local file, worked fine in greasemonkey , failed in safari. it's hard ins-and-outs of ninjakit currently, in experience.
Comments
Post a Comment