I had this function not being recognized as defined in latest Firefox for Linux, though Chromium was dealing fine with it.
What happened in my case was that I had a former SCRIPT
block, before the block that defined the function with problem, stated in the following way:
<SCRIPT src="https://stackoverflow.com/questions/153909/mycode.js"/>
(That is, without the closing tag.)
I had to redeclare this block in the following way.
<SCRIPT src="https://stackoverflow.com/questions/153909/mycode.js"></SCRIPT>
And then what followed worked fine… weird huh?