Forum Moderators: open
Any ideas or even pointers a site listing the safari javascript quirks would be appreciated. Thanks in advance.
[edited by: DrDoc at 12:56 am (utc) on Feb. 18, 2006]
[edit reason] No URLs, thanks. See TOS [WebmasterWorld.com] [/edit]
First, the TOS [webmasterworld.com] doesn't allow linking to your own sites. A moderator will be by shortly to snip those URLs. The approach here is to reduce down problematic code until you've identified the specific bit that is causing the problem.
Second, I went ahead and did that with your script. :) You currently use this method to loop through the nodeList of <a> tags:
for(i in anchor_list)
Inside that loop, I added a little bit of code so I could ensure that was working:
anchor_list[i].style.background='#cccccc';
On opening the page, the links all kept their default background, so the assignment of the function to the onclick of each <a> tag wasn't even occurring.
Now, I've not seen a loop that looked like yours (probably because of my inexperience), so I replaced it with what I typically use:
for(var i=0; i<anchor_list.length; i++)
And, that change makes your script work in both Safari and Mac Firefox. :)