开发者

greasemonkey script won't work on FaceBook

i have this code:

==UserScript==
// @name          name
// @namespace     url
// @description   desc
// @include       http://www.facebook.com/*
// @require       http://code.jquery.开发者_如何学Gocom/jquery-1.5.2.min.js
// ==/UserScript==

$(document).ready(function() {

    $("a").click(function(){
        alert(1);
        return false;
    });

});

but when i install it, and click on some link i'm just taken to the adress, which means the script doesn't work.

can anyone tell me where's my mistake?


Your code looks fine and works for me on FF 4.0.1 with GM 0.9.2. You haven't specified the Firefox or GM version that you're working with - but I think I remember running into a problem where the external scripts would not get loaded. You might try copying and pasting the entire minified source of jQuery into your GM userscript, just after the header, before your code.

You might also want to make sure your code actually does get loaded by putting in some log/alert statements - I'd suggest $().jquery at least to ensure you have jQuery loaded and check it's version.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜