Differences between page loading by extjs through autoload and embedding pages by IFRAME

Source: Internet
Author: User

Recently, the project needs to use extjs4.0. In the homepage framework, click the menu to dynamically load the response page. I found some information on the Internet and found that there are two methods to achieve this. One is to load the page through autoload, one is to request a response page through URL in IFRAME. It can be said that these two methods have their own advantages, but I prefer to load them by using autoload.

The two methods are implemented as follows:

IFRAME method:

The HTML in the display area is followed by an IFRAME. HTML: '<IFRAME scrolling = "Auto" frameborder = "0" width = "100%" Height = "100%" src = "' + URL + '"> </iframe> '.

The URL is a passed connection. It can be a page or a parameter, such as A. jsp or user. do? O = tolist. In this way, you can directly load the page you want, and whether you perform operations on the loaded page updates the whole page, instead of updating the page you load.

The advantage of loading a webpage through the <IFRAME> element is that it is easy to operate and understand, and you can control the response page style through the style file. But this method has a great disadvantage is that every request to re-load the ext-all.js file, this greatly increased the corresponding event, extjs speed was originally criticized, if this method is used, the request speed will be greatly affected.

Autoload method:

Autoload {URL: aimurl, scripts: true}

The advantage of this request is that you don't need to load a ext-all.js every time you request a page, but do not need to load the file after introducing the ext-all.js when loading the home page, which greatly reduces the system overhead, this method improves the response speed. Therefore, we recommend that you load the response page. However, note that after the page is loaded using autoload, the loaded page conflicts with the variables on the original page, that is, if the variables of the two pages are named the same, the previous variables will be replaced later.

The above is just a bit of my recent learning experience, with a limited level and incorrect understanding. You are welcome to discuss it together.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.