Most websites have a fixed structure and perform partial refresh. We can use ajax to refresh the HTML code in the placeholder Div or span. However, HTML snippets are much more difficult to write than the entire HTML page. Therefore, many websites use IFRAME to divide the entire page into several relatively independent parts, each of which corresponds to a complete HTML page.
The following is an example of the common combination of IFRAME and form, which is suitable for applications in the MVC Architecture. The example is very simple:
Home page: iframe.html
<HTML>
<Head>
<Title> HA </title>
</Head>
<Body>
<Form name = "form1">
<Div>
<IFRAME name = "query" src = "test.html"> </iframe>
<IFRAME name = "list"> </iframe>
</Div>
<Div>
<IFRAME name = "theid"> </iframe>
<IFRAME name = "thename"> </iframe>
</Div>
</Form>
</Body>
<Form name = "jumpform" target = "theid" Action = "test.html">
<Input type = "Submit" value = "Submit">
</Form>
</Html>
Subpage: test.html
<HTML>
<Head>
<Title> Hello </title>
</Head>
<Body>
Ben hello!
</Body>
</Html>
We can see that the home page is divided into four independent blocks. In the IFRAME tag, the property SRC is used to specify the HTML subpage to be displayed. Here, JavaScript can be used for dynamic display.
In jumpform, the target value is defined as IFRAME-theid. At this time, when the form is submitted, the returned page will be displayed in the IFRAME of theid.
Target attribute:
_ Blank ---------- new window
_ Self ----------- self
_ Top ------------ main framework
_ Parent --------- parent framework
The custom name ----- appears in the framework structure, and the link is opened in the framework of the name.
The target attribute specifies how to open the linked page in a browser window. Its parameter values include _ blank, _ parent, _ self, and _ top, the meanings of these parameter values are as follows:
◎ _ Blank: Open the linked file in the new browser window.
◎ _ Parent: load the linked file into the parent frame set or parent window containing the linked framework. If the frame containing the link is not nested, load the link file in the full screen window of the browser, just like the _ Self parameter.
◎ _ Self: Open the linked document in the same framework or window. This parameter is the default value and is not required.
But I don't quite understand
◎ _ Top: Open the linked document in the current entire browser window and delete all frameworks