Javascript Application: Iframe adapts to the content height loaded by Iframe
Main.htm:
The Code is as follows:
Iframe Adaptive Page height
Child.htm:
Iframe adaptive webpage loading (compatible with multiple browsers)
Due to project requirements, all the pages on one server are static pages, and the other is an application server.
Therefore, you need to use IFRAME to nest the development modules on the application server.
The result is a very serious problem. The detailed page cannot receive URL parameters, and the URL parameters in IFRAME cannot be accessed.
Therefore, the solution is to remove the URL parameter fr
Call between html iframe elements, iframe call
Call between html iframe elementsI. IntroductionIframe is usually used when an independent page needs to be introduced. When necessary, we need to interact between the parent page and the iframe page. When interacting, we need to makeJavascript or jquery is used to operate
On the internet for a long time the IFRAME refresh, almost all the same, did not solve the problem. Finally try to come out, record. HTML code:
JS Code:
function Sendzch (zch) {
$ ("#map iframe"). attr ("src", '/bonc_ioc_screen/views/screen/company/jkqmap3.html?zch= ' +ZCH);
}
Just change the src attribute of the IFRAME to complete the refresh.
----------
Two iframe on the same page, how to display the link content to another IFRAME after clicking on the link in one of the IFRAME
Two iframe IDs are iframe1 and iframe2, and click the link in iframe1 to display to Iframe2
The iframe1 contains a a.aspx,
The code in A.aspx is:
JS section:
function LoadPage (page){if (page!
Scrollby (x, y) adjusts this parameter to display the region you specified
Note: This method does not support cross-Origin
If you want to nest pages across domains, add code in the
In this way, the IFRAME can be nested across domains !~
Note: The premise of the sub-method implementation is that you must have the right to edit the code of the two forms.
Another method is to implement IFRAME nes
This is a problem encountered in the project:
Two IFRAME labels are used on the project background operation page to display different menu content. The page shows that everything works normally under IE7 and Firefox. however, once Internet Explorer 6 is used, the client may have a 90% chance of displaying "this page cannot be displayed". You need to refresh the page several times to display the content normally. Put the path on the page in
Compile js on the page of iframe to create a div for expanding and shrinking the animation effect in the parent window (without changing the iframe parent window code)
The Code is as follows:
String query = request. getParameter ("query ");MMStock2BudgetLogic bean = new MMStock2BudgetLogic ();String xmldata = bean. statStock2Budget ();%>
Total procurement expenditure ratio of inventory point
Compile js on the page of iframe to create a div for expanding and shrinking the animation effect in the parent window (without changing the iframe parent window code)
The Code is as follows:
String query = request. getParameter ("query ");MMStock2BudgetLogic bean = new MMStock2BudgetLogic ();String xmldata = bean. statStock2Budget ();%>
Total procurement expenditure ratio of inventory point
Parent page:IFrame Popup page (1.html): To close the div that contains the IFRAME in the IFRAME pop-up layer (the child page calls the parent page JS function)
IFRAME element | IFRAME object
Create an embedded floating framework.
Member table
The following table listsIFRAMEObject. Click the label on the left to select the member type you want to view.
Tag attributes/attributes
Displ
1. The parent form obtains the IFRAME window object.
VaRMainframe = Document. getelementbyid ("Myframe");VaRSubdocument = mainframe. contentdocument | mainframe.content##doc ument;
2. Get the window object of the parent form in IFRAME
Method: (browser compatibility)
Window. Parent
A few days ago, I learned this together in the group...If you only want to check whether the page exists or not, you can directly set the target to use the pseudo protocol to solve the problem...However, if IFRAME [name] is used, it will involve the onload issue... so it will be a lot of trouble ....The following only adds a delay... there is no "real" issue of onload processing .... in fact, we can loop through windows. open to solve the problem, but
But Iframe[name], it involves the onload question ... So it's a lot of trouble ....
The following is only added delay ... There is no "real" deal with the onload problem .... In fact, can be recycled window.open to solve, but lazy to get a little ... ^^
To the point, we need to pay attention to the place : HTML5 no longer support the use of Frame,iframe only SRC attribute
I. Advantages and disadvantages of using IFRAME
Advantages:
1. It is more convenient to transfer the program into static page;2. Page and program separation;
Disadvantages:
1.iframe has a bad point: the style/script requires additional lin
Same-domain, sub-page height does not increase dynamically
This situation is the simplest, directly through the script to get the actual height of the word page, modify the height of the IFRAME element. But there are two points to note:
If the page has absolute positioning or not clear floating elements, the situation is somewhat complex, different browser processing results are different, even including the WebKit kernel browser, specifically see t
In IE6, IE7, we can use Document.frames[id].document to access the Document object in the IFrame Subwindow, but this is not in line with the standard of the writing, is also the unique method under IE, It is not available under Firefox, and Firefox uses the document.getElementById (ID) in accordance with the standard. Contentdocument method, today I write an instance, through IE8 test, IE8 is also a document.getElementById (ID) that is used in accorda
The has recently been involved in the development of a project that has a large number of calls to IFRAME on the page because the project is a rich browser-based client (RIA) application. Late test found that browser memory has been high, and open the IFRAME page more memory footprint, especially in the IE series browser. All open iframe pages even closed, memor
Many of the frameworks have a parent-child relationship that is cumbersome to operate, and many students often have this sad code:
The code is as follows
Copy Code
Window.parent.document.getElementById ("main"). ContentWindow.document.getElementById (' input '). Value =document.getElementById (' Myiframe '). ContentWindow.document.getElementById (' S0 '). Value;
Look at a case I made myself.
An IFRAME invocation
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.