简体   繁体   English

XmlHttpRequest 或 iframe 加载 web 应用程序?

[英]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.我正在使用的 web 应用程序有一点性能问题,我想知道如何解决它。

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.你看,当我进入我的 web 应用程序时,一切都开始加载并且需要一些时间,因为应用程序向数据库发出一些请求以检索一些数据。 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.我想知道我是否可以将 iframe 放在带有我的应用程序链接的空白页面上,这样它就可以开始在 iframe 中加载,从而使页面的 rest 工作并且不会卡住。

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.我尝试在请求 web 应用程序链接的空白页面上添加 XmlHttpRequest ,但它只检索立即加载但停在那里的第一个元素。 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.它不会在第一刻之前加载所有元素,因为由于 web 应用程序发出的数据库请求,它们会出现一些延迟。

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?你们如何认为我可以将我的 web 应用程序加载到另一个页面中,而当我的 web 应用程序加载时,我仍然可以使用其他页面的 rest 而不会卡住?

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.我通过添加一个不可见的 iframe 解决了这个问题,它在后台加载我需要的页面,在前面我用我的应用程序检索所有内容。 Once I finish, I just delete the iframe on the background and move to the next task.完成后,我只需删除后台的 iframe 并转到下一个任务。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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