'Member not found' error in jquery 1.4.4 when a left click is done on an element with a RightClick qtip event mapped to it #38
Comments
I forgot to mention I ran into this because a prototype I am building has a DIV element that has a mouseover qtip, then a RightClick qtip and is also selectable. I was super excited when I figured out how to get RightClick working, and have it hide the mouseover qtip (although not perfectly yet) when it was invoked. But then when I tried to LeftClick on the DIVI to select it I got the error above. :( So I created a watered down prototype that is only the RightClick qtip to pinpoint what is happening for this defect submission. |
http://jsfiddle.net/fDavN/107/ This seems to be working fine for me in all browsers...? |
Hey Craig. I sent an email directly to you on this. I can't see a way of adding attachments at GitHub so I used email to send you screen grabs of what I am seeing. |
This seems to be fixed now, woo :) |
Thanks Craig! |
I am still able to reproduce this error here http://jsfiddle.net/fDavN/107/ in IE 7. Are there any known work arounds? |
Does this occur in the later jQuery versions or just 1.4.4? |
This should be reopened.. this is occurring for me too. Only in IE 1.8 (im using jquery 1.5.*) |
I'm not seeing this on any of me IE installs... are you sure the error you're referring to isn't from the jsfiddle page itself? As I get do get errors when running it in the results pane, but none running it directly: http://jsfiddle.net/fDavN/107/show/result/ |
Hi Craig, yes I'm sure its not from the jsfiddle site.. this is a local (non public) server using the google hosted jquery 1.5 and the error only occurs for me in IE8. I was trying not to display empty titles via the config but in the end I avoided the problem by altering the toggle function to set state to false and type to hide if the title was empty. |
Does the error occur on the results page I listed? |
yes.. right click works as expected left click breaks with the message something similar to 'member not found' |
This seems to be an issue with how jQuery handles nested event.originalEvent. It's fixed in 1.6 but the easiest way around it is to use a try/catch block. See: http://jsfiddle.net/XHCXb/15/ The tutorial on right-click detection has been updated with the new code. |
Am I reading that right in that there is no preventDefault solution for IE8 then til jquery 1.6.. I should stay with my hack? |
Oh preventDefault() does work, it's just that when you have multiple nested originalEvent properties inside your custom events, it causes a problem since jQuery <1.6 assumes all originalEvent objects are primary event objects and tries to set returnValue property for it, even though it might not be there, hence the "Member not found" error! Try try/catch just stops it throwing an error when setting a deeply nested object property, but still actually prevents the default action:) |
jquery 1.7.2 + qtip2 Mon Jun 18 08:09:07.0000000000 2012 |
Same in 1.7.2. Code: var _s = $('#group_filter');
var _to;
_s.change(function(event){
clearTimeout(_to);
_to = setTimeout(function(){
event.preventDefault();
// Do stuff
}, 2000 );
return false;
}); |
Can reproduce this error in IE8, jQuery 1.8.2 and qTip version of today: $.fn.qtip.defaults = $.extend(true, {}, $.fn.qtip.defaults, {
events: {
// only show tooltips if title or copyright exists
show: function(event, api) {
if (api.elements.target.data('title') === '') {
event.preventDefault();
}
}
}, ... Maybe this is related to this jQuery bug. The jQuery error handler |
The best way to get around this is so simply try/catch it, until jQuery core fix it |
I now solved it with a more narrow element selection:
This made the show event unnecessary then. |
I don't know if this is a defect with qtip2 or jquery. I get this error when I am in IE8. I don't see an obvious error show up in Chrome or FireFox but I don't know those browsers well enough to say there isn't an error.
But given the code that is bombing in jquery seems to be an else clause for IE I assume there is no error raised in those browsers. Below is the segment from jquery that raises the error. I put a comment in [] to show where the error is. In the unminified jquery 1.4.4 it errors on line 2442 character 4
I tend to think it is a jquery defect but I know they always want a streamlined jsfiddle with no plug-ins and I don't know how to trigger this error without qtip2.
// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
jQuery.Event.prototype = {
preventDefault: function() {
this.isDefaultPrevented = returnTrue;
Here is a full screen jsfiddle and the share link. It is just a single div with a RightClick qtip tied to it.
http://jsfiddle.net/danoman7/NFy2W/embedded/result/
http://jsfiddle.net/danoman7/NFy2W/
The text was updated successfully, but these errors were encountered: