Javascript self executing function “is not a function”

后端 未结 6 665
慢半拍i
慢半拍i 2020-12-07 23:09

I have:

var Init = (function() {
   my js goes here
})();

And my js executes correctly when the page is loaded. I also have:



        
6条回答
  •  旧时难觅i
    2020-12-07 23:57

    Quick one Try replacing like this

    var Init = function() {
       my js goes here
    });
    

    and on load call Init

提交回复
热议问题