Firefox Reserved Function Names?
Thursday 3rd December, 2009
I've just been developing a new javascrpt function for my CMS that simply hides one DIV layer and exposes another. In fact, its a function I thought I had polished off ages ago but upon returned to it this evening I found it didn't work as intended. Theres a little more too it than just changing the DIV layer display state (hence the difficulty) but essentially that is the end result.
Anyway, as I say, upon returning to the function this evening I found it wouldn't work at all - I tried adding alerts in to check if it was even being fired off and nothing - I wasn't getting any errors reported either, literally nothing was happening.
Eventualy I decided to try the page in Internet Explorer (I had been working in Firefox 3.5.5) and lo and behold, it worked absolutely fine.
To cut straight to the chase (rather than taking you through everything I tried inbetween) it turned out to be nothing more than the function name! I was using the name 'next' - which as far as I knew isn't a reserved word in javascript, but there we are - once it was changed it started working in Firefox absolutely fine.
Couldn't find this documented anywhere else online, so thought I'd note it down here.
Comments
Please login to comment on this page