Test if jquery is loaded not using the document ready event

后端 未结 6 1118
北海茫月
北海茫月 2020-12-19 05:28

On my site I have a jquery function which retrieves data from another (secured) server as soon as the page is loaded. Using a jsonp call I currently load this data after doc

6条回答
  •  半阙折子戏
    2020-12-19 06:05

    As long as you place the script tag that includes jQuery above your script tag that runs your function then it should work fine.

    Wrapping your script in this instead of the ready function may help:

    (function() {
        // Your code here
    })();
    

提交回复
热议问题