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.