• Hey all,

    I’m having a jQuery related problem and was wondering if someone here could help?

    My code below works fine in all browsers except IE (I know this becasue they all show the alert box except IE), yet for some reaseon the first a element within #attachment-body is still being prevented in IE –

    $('#attachment-body').delegate("a", "click", function(e){
    	alert('HERE!!!!');
    	e.preventDefault();
    });

    I’ve searched high and low for an answer to this, and it’s been suggested that there is a problem with the WP core that causes IE to ignore these events in certain cases, but I’m lost as to where to look.

    Any help here would make me very happy.

    Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi there,

    You may find this Stack Overflow thread helpful. It is suggested there that the issue should not be occurring anymore after jQuery 1.5 and IE 9.
    I also found this thread on the jQuery forums.
    That is all I was able to find.

    Hope that helps!

    Thread Starter David Gard

    (@duck_boy)

    Thanks for the reply. I believe I have found the answer now, and it’s all to do with the order in which IE runs commands – basically, it was running a function triggered with onClick() before it was checking to see if the associated link should be disabled, where as all other browsers were doing it the other way around. I found very little on it, but what I did find suggested that it was away for MS to try and speed IE8 up (can’t use IE9 as this is a work project, and we do not have IE9 compatible machines).

    Bottom line – I have it working now, by changing one on line in my JS function that was fired by onClick(). This –

    document.getElementById('attachment-body').innerHTML = '';

    Became this –

    document.getElementById('attachment-body').style.display = 'none';

    Thanks.

    Glad to know you figured it out.
    Good luck on your project!

    Hi,

    Could you please mark this thread as resolved?

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘IE ignoring jQuery.delegate()’ is closed to new replies.