Self invoking functions javascript

后端 未结 6 1497
长发绾君心
长发绾君心 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:37

    This self invoking function with return value will work in all current browsers(Safari, Chrome and Firefox) without issue. This function executes immediately, automatically and anonymously.

    
    

提交回复
热议问题