简体   繁体   中英

XmlHttpRequest or iframe to load a web application?

I have a little perfomance issue with a web application I am using and I would like to know how can I solve it.

You see, when I enter to my web application, everything starts loading and takes some time since the application make some requests to a database to retrieve some data. I would like to know if I can put an iframe on a blank page with the link to my application so it can start loading inside the iframe making the rest of the page work and not getting stuck.

I've tried adding a XmlHttpRequest on a blank page requesting the web application link but it onlys retrieves the first elements that loads instantly but stops there. It doesn't get all the elements loaded before the first moment since they have some delay to appear because of the database request the web application makes.

How you guys think that I can load my web application inside another page and while my web application loads, I can still use the rest of the other page without everything getting stuck?

I hope you guys could guide me a little bit. Thank you in advance!

I've solved this by adding an invisible iframe that loads the page I need on the background and on the front I retreive everything with my application. Once I finish, I just delete the iframe on the background and move to the next task.

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