NickMaller wrote:
Thanks everyone for your responses,

In regards to upgrading to a newer version, it's part of my client's
requirements for it to be compatible with this particular combination
as it's based on feedback and stats from thier users. It would be a
lot simplier if everyone just used 1 browser but thats in an ideal
world like Sam mentioned.

I've tried using e.preventDefault() previously and it helped slightly
(ie. it worked more time than what it was previously) but ultimately
the bug still pops up. If it's a problem with that version of safari
and the addEventListener is there an alterntive way that should be
used in the jquery code to address this?

Thanks again
-Nick

I looked up an older project of mine and found this bit of code, kind of crazy to me these days:

// Woraround for Safari 1.0, which does not execute preventDefault()
var isSafari = navigator.userAgent.toLowerCase().indexOf('safari') != -1;
if (isSafari) {
    var onClick = aElem.onclick; // save existing event
    aElem.onclick = function() {
        return false;
    };
    if (typeof onClick == 'function') {
        addEventHandler(aElem, 'click', onClick);
    }
}
addEventHandler(aElem, 'click', function(evt) { ... };

That code comes from the pre jQuery dark ages, thus I was using a common addEventHandler function. What it does is adding a "return false" function to the onclick attribute immediately, which is the only way to make it work in these dinosaur safaris, and then the actual listener is added.

That worked well. Damn, DOM scripting was hard in Safari these days.

You could translate that to jQuery...



--Klaus

Reply via email to