0
我有2点击处理程序为相同的元素。jQuery错误点击元素与2点击处理程序
说#1
$(':input, a').bind('click', function(e) {
if(e.ctrlKey) {
// do something with all links and inputs
}
});
和#2:
$('a#some-special-link').click(function() {
// do something special also with current link only
});
当我点击一次链接的 “A#一些特链接”我总是得到一个错误里面的jQuery核心行: return typeof jQuery!==“undefined”& &!jQuery.event.triggered?
if (!eventHandle) {
elemData.handle = eventHandle = function() {
// Handle the second event of a trigger and when
// an event is called after a page has unloaded
return typeof jQuery !== "undefined" && !jQuery.event.triggered ?
jQuery.event.handle.apply(eventHandle.elem, arguments) :
undefined;
};
}
错误说: 类型错误:2200来源:HTTP:行类型错误//localhost/js/jquery-1.5.1.js
该错误只发生在第一次点击#some-special-link链接。每次下一次双击处理程序都可以正常工作。
我不确定是什么原因。我需要的是执行#1和#2点击处理程序。
请帮我找什么在那里发生的...
更新:我得到同样的错误(当我改变徘徊的情况下,和悬停鼠标的任何链接或输入):
$(':input, a').bind('hover', function(e) ...
我只能在#1单击处理程序编辑,我无法改变既不#2点击处理,也不“特殊链接”标签定义 – Zelid 2011-03-28 21:05:31