JavaScript Load Order

后端 未结 8 2358
没有蜡笔的小新
没有蜡笔的小新 2020-11-30 06:38

I am working with both amq.js (ActiveMQ) and Google Maps. I load my scripts in this order


    

        
相关标签:
8条回答
  • 2020-11-30 07:15

    Is there a way to make sure both scripts load before I use them?

    Yes.

    Put the code you want loaded last (your application.js stuff) into prototype's document.observe. This should ensure that the code will load only after prototype + other stuff is finished and ready. (If you are familiar with jQuery, this function is similar to jQuery's $(document).ready )

    0 讨论(0)
  • 2020-11-30 07:21

    You can also use the built in SharePoint javascript method to control the execution of your scripts;

    _spBodyOnLoadFunctionNames.push("yourFunction");
    
    0 讨论(0)
提交回复
热议问题