동일한 요소에 대해 2 개의 클릭 핸들러가 있습니다.2 클릭 핸들러가있는 jQuery 오류 클릭
말 # 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
});
것은 내가 항상 오류가 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 처음 # a some-special-link 링크를 클릭합니다. 다음 번에 두 클릭 핸들러 모두 정상적으로 작동합니다.
이유가 무엇인지 잘 모르겠습니다. # 1과 # 2 클릭 핸들러가 모두 실행되면됩니다.
, 거기에 무슨 일이 일어나고 있는지 찾아 도와주세요 ...
업데이트 :은 내가 가져가 할 수있는 이벤트를 변경할 때 (같은 오류가 발생하고 어떤 링크 나 입력에 마우스를 가져) :
$(':input, a').bind('hover', function(e) ...
를, 내가 어느 # 2 클릭 핸들러를 변경할 수없고 "some-special-link"태그 정의 – Zelid