It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Partner Sites
Board index Programming JavaScript Forum

IE8 unusual event handling

IE8 unusual event handling

Postby dagda on Fri Sep 18, 2009 2:59 pm

Hi,

I've been asked to fix an old and stable web application which heavily relies on Javascript, so that it will work in the IE8 browser. So far it has worked just fine in IE6 and Firefox browsers. I've fixed a few problems so far but there is one that has me stumped.

The web app is based around an image. A mouseup event handler is registered on the image and the last line of this handler makes an explicit call to:

Code: Select all
image.click()


The image is contained within a form and this code leads to a form.submit() which redraws the image, with some additional information added.

With IE8 I noticed that when I release the mouse button, sometimes the images doesn't redraw. It was very hard to debug but I eventually figured out that if I comment out the line

Code: Select all
image.click()


the app works fine on IE8. When it's commented out, it doesn't work on any other browser. It's obvious that for some reason, in IE8 another element is catching the mouseup event. I've spent a lot of time debugging, but I just can't locate this other element.

Am tempted to just add some condition:

Code: Select all
if (!IE8 browser) {
    image.click();
}


this will solve the problem but I consider it a hack. (also, does anyone have any reliable test which identifies a IE8 browser??)

I tried setting
Code: Select all
cancelBubble = true;
but it made no difference.

Any suggestions appreciated.

Thanks
dagda
 
Posts: 1
Joined: Fri Sep 18, 2009 2:42 pm

Return to JavaScript Forum

Who is online

Users browsing this forum: No registered users and 7 guests