Note This
« February 2005 »
S M T W T F S
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28
You are not logged in. Log in
Entries by Topic
All topics  «
Blog Tools
Edit your Blog
Build a Blog
View Profile
Thursday, 24 February 2005
Mozilla doesn't support JavaScript click()
A friend mentioned he couldn't trigger a click event via script through the click() method on Mozilla Firefox. It works fine for Internet Explorer (which of course almost everything does... including all the exploits to deliver spyware and virus to your desktop without your knowledge and certainly not consent). Anyway, this seems a work around, albeit a quick and dirty hack.


hobbits rule

Here's the code... cut/paste it to test yourself.

<br><a id="test" href="http://www.eshire.net">hobbits rule</a><br><br><script><br>obj = document.getElementById('test')<br>if(obj.click) obj.click()<br>else obj.addEventListener('click',location.href=obj.href,false)<br></script><br>

Posted by my-webpage-05 at 3:17 PM EST
Updated: Thursday, 24 February 2005 3:19 PM EST
Post Comment | Permalink

View Latest Entries