Where are scripts loaded after an ajax call?

后端 未结 5 499
日久生厌
日久生厌 2020-12-11 05:44

suppose you have a simple web page that dynamically loads content that looks like this:

- main.html -




        
5条回答
  •  执笔经年
    2020-12-11 06:36

    My solution would be rather simple

    Why not load the the files needed in main, on the first load all together? Then simply have a listener event. (Check if the content is simply loaded?)

    The only solution for loading on demand...

    You simply has to AJAX call the script file itself...

    
    

    My way

    Make some type of loader instead on the actual page on load before displaying anything. (Plenty of tutorials with jQuery around the web for this.)

提交回复
热议问题