Cheers,
You can use DOM2 Events for this. Note that that won't trigger the link
traversal unless you're privileged script, but it _will_ fire onclick handlers.
-Boris
I'm assuming you mean something like this?
var evt = document.createEvent("UIEvents");
evt.initUIEvent("click", true, true, window, 1);
AnchorFieldObj.dispatchEvent(evt);
Unfortunately the onClick event on the Anchor element doesn't fire
with this so I assume I am doing something wrong?
Cheers,
I'd use MouseEvents myself. And initMouseEvent.
-Boris
Hmmm... even using the following code the onclick() event handler
never fires... am I still missing something?
var evt = document.createEvent("MouseEvents");
evt.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false,
false, false, false, 0, null);
AnchorFieldObj.dispatchEvent(evt);
Offhand that looks like it should work....
-Boris
You're absolulte correct - it is working! I had something else wrong
as well. Thanks for your help - much appreciated!