Reputation: 3216
there. I'm using jQuery to add a click handler to some buttons I'm using for a calendar, but the context doesn't seem to matter much. I've tried putting anything (or nothing) in the function that's called by the click event.
If I click the button a few (three or four) times in succession, I get an error. It doesn't actually seem to affect the execution of the function itself. It just throws an error, which concerns me, obviously.
The code in question is as follows:
$("#backward").click(function(event){. . .});
And the error I'm getting is:
Error in event handler for 'undefined': INDEX_SIZE_ERR: DOM Exception 1 Error: Index or size was negative, or greater than the allowed value.
at J (chrome-extension://mgijmajocgfcbeboacabfgobmjgjcoja/content_js_min.js:14:142)
at null.<anonymous> (chrome-extension://mgijmajocgfcbeboacabfgobmjgjcoja/content_js_min.js:17:184)
at chrome-extension://mgijmajocgfcbeboacabfgobmjgjcoja/content_js_min.js:1:182
at miscellaneous_bindings:286:9
at chrome.Event.dispatchToListener (event_bindings:379:21)
at chrome.Event.dispatch_ (event_bindings:365:27)
at chrome.Event.dispatch (event_bindings:385:17)
at Object.chromeHidden.Port.dispatchOnMessage (miscellaneous_bindings:253:22) event_bindings:369
chrome.Event.dispatch_ event_bindings:369
chrome.Event.dispatch event_bindings:385
chromeHidden.Port.dispatchOnMessage miscellaneous_bindings:253
Obviously, the problem is with that extension, which is just Google Dictionary.
I'm not sure if the problem is with me or with that, but I'd prefer for my website not to clash with Google Dictionary...
Thanks!
Upvotes: 9
Views: 6908
Reputation: 6738
If it's clashing with something else you can always use:
$("#backward").click(function(e){
e.preventDefault();
. . .
});
Upvotes: 7