Page is a not externally linkable
- Code, Content, and Presentation
-- JavaScript and AJAX
---- calling & defining functions using funcName() vs. window['funcName']()


sssweb - 2:44 pm on Jan 5, 2013 (gmt 0)


There is still some glitch with this. If you change your [jsfiddle.net...] so that funcName0 is NOT defined in window[] format and the calls ARE in window[] format, those functions do not work (I removed the offending funcName1 entirely, since that's the ready() option we're getting rid of; I then made both calls to funcName0). I get the same error reported above (Object doesn't support property or method 'funcName0').

Then there's this: on my site, if I put the funcName0 def OUTSIDE (before) your anonymous function it actually works, but if I do that on your fiddle mock-up, it still doesn't.

I get similar results when using external files (I created an anonymous function for each and put everything inside that, with func defs OUTSIDE ready(), as you suggest.)


Thread source:: http://www.webmasterworld.com/javascript/4533285.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com