JavaScript Load Order

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

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


    

        
8条回答
  •  萌比男神i
    2020-11-30 07:08

    in jquery you can use:

    $(document).ready(function(){/*do stuff here*/});
    

    which makes sure the javascript is loaded and the dom is ready before doing your stuff.

    in prototype it looks like this might work

    document.observe("dom:loaded", function() {/*do stuff here*/});
    

    If I understand your problem correctly.. I think that may help..

    If you don't want to rely on a lib to do this... I think this might work:

    
    
    

提交回复
热议问题