RobG wrote:
<quote>
A quick example using the above reference (tested in Fx 2.0, IE 6 and
Opera 9):
function simulateClick(elId) {
var evt;
var el = document.getElementById(elId);
if (document.createEvent){
evt = document.createEvent("MouseEvents");
evt.initMouseEvent("click", true, true, window,
0, 0, 0, 0, 0, false, false, false, false, 0, null);
}
(evt)? el.dispatchEvent(evt)
el.click && el.click());
}
</quote>
ASM wrote:
<quote>
Sorry, doesn't work with my Safari :
Value undefined (result of expression evt.initMouseEvent) is not
object.
</quote>
VK wrote:
<quote>
ith the same success you could say "It doesn't work on NCSA Mosaic"
Did you try on some descent browser people are using?
</quote>
RobG wrote:
<quote>
Is that it? Is that all you have offer? Did you discover that Safari
actually supports element.click() just like IE?
</quote>
As you may see (when the conversation chain is restored) Safary doesn't
support click() method "just like IE": otherwise it wouldn't fall on
wrong if-else branch. What Safari does (from the time it first
appeared) it supports a narrow set of features in a generously twisted
way but at the same time it covers all possible "holes" with loophole
(blackhole) methods.
Is it possible to make a workable solution for Safari? Almost always
yes, sure: just like it would be possible for Netscape 4.x. And just
like with Netscape 4.x currently the expenses would overcome benefits -
by my calculations which may differ a lot from someone else's
calculations.
I do not see myself obligated of being "supportive and respectful" to
any single browser on the market as long as it's not IE ;-) I call junk
on junk: and Safari prior 2.x is a jankiest junk in the junk book. And
that is an ugly stain in a company like Apple who always put quality of
the final product as their top priority.
At the same time, as anyone may notice, if I know how to fix this poor
mutant for this or that particular situation - I always say how.