Wednesday, June 25, 2008

Firefox 3 Broke My Code

Yesterday, I had to install Firefox 3, because my most recent work stopped functioning properly in the new Firefox. I wanted to wait a little longer for Firefox 3 to be more stable, but had no other choice. Who would have thought the new version of my beloved Firefox would break my code? Basically, it had to do with my 3 Javascript functions that I wrote: OnMouseOver, OnMouseOut and OnClick. In the OnMouseOver function, I used the innerHTML property to replace some div text. I'm not sure if anybody else had this problem with the new Firefox, but the innerHTML property prevented my OnClick function from being called. I figured this out using my favorite Javascript debug method: alert('test'); It took me the whole day yesterday debugging and researching on Google, but still came out clueless. I ended up throwing away the innerHTML code and used the image src property instead. From experience, I've found sometimes it's best to throw away my current non-working solution and start fresh.

No comments: