Why is my JavaScript function sometimes “not defined”?

后端 未结 13 1804
逝去的感伤
逝去的感伤 2020-12-24 01:18

I call my JavaScript function. Why do I sometimes get the error \'myFunction is not defined\' when it is defined?

For example. I\'ll occasionally g

13条回答
  •  礼貌的吻别
    2020-12-24 02:09

    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:

    
    

    And then what followed worked fine... weird huh?

提交回复
热议问题