Self invoking functions javascript

后端 未结 6 1506
长发绾君心
长发绾君心 2021-01-19 14:07

I wrote a self invoking function in both firefox and chrome it it wouldn\'t invoke.

I wrote something to the effect of

(function () { alert(\"THE\")         


        
6条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-19 14:33

    I had this issue with a self invoking function which produced this error...

    Uncaught TypeError: object is not a function
    

    The problem was caused by not having a semi colon ending the line before the opening bracket

提交回复
热议问题