Why is my JavaScript function sometimes “not defined”?

后端 未结 13 1922
逝去的感伤
逝去的感伤 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 01:46

    This doesn't solve your original problem, but you could always replace the call to copyArray() with:

    __args = Array.prototype.slice.call(arguments);
    

    More information available from Google.

    I've tested the above in the following browsers: IE6, 7 & 8B2, Firefox 2.0.0.17 & 3.0.3, Opera 9.52, Safari for Windows 3.1.2 and Google Chrome (whatever the latest version was at the time of this post) and it works across all browsers.

提交回复
热议问题