小编Bra*_*don的帖子

在greasemonkey中使用jQuery插件(即醉意)

我正在尝试(并且大部分成功)在我的greasemonkey脚本中使用tipsy jQuery插件.我正在使用@require元标记来导入jquery和tipsy js,它可以工作,但有一些我要克服的警告.

作为纯jQuery对象访问元素失败,所以我将降级为使用DOM函数来获取我的元素:

//this fails
$('#login').find('a:first').tipsy(); 

//while this succeeds
$(document.getElementById('login').getElementsByTagName('a')[0]).tipsy();
Run Code Online (Sandbox Code Playgroud)

谁知道为什么?需要更多信息?TIA!

javascript jquery greasemonkey jquery-plugins

3
推荐指数
1
解决办法
400
查看次数

标签 统计

greasemonkey ×1

javascript ×1

jquery ×1

jquery-plugins ×1