Self invoking functions javascript

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

    This function definitely works. I would check your browser's console for any js errors in your page. Perhaps you could try to put a simple console.log function at the beginning of your script to see if any JavaScript is being called in the first place.

提交回复
热议问题