简体   繁体   中英

Load External javascript, but HTTP request repeatedly for one file javascript

I have problem when load external html into specific <div> . Here is the problem :

  1. I have html files, "index.html" and "problem.html" .
  2. In problem.html I use skrollr to animate content.
  3. When I click the "open" button in index.html, I use jquery load() method to load problem.html into specific in index.html.
  4. The content was loading, but slowly.
  5. When I check using firebug, I see many request skrollr.min.js . Why do I get skrollr.min.js and other file repeatedly?

When I refresh the page, load the menu and see at the firebug there are so many get skrollr.min.js and file that are called.

You could try to load the Page via iframe to see if it's faster. Just set the innerHTML of your container to

<iframe src="http://yourdomain.com/problem.html"></iframe>

when he clicked the Button.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM