This article introduces JS and jquery to obtain the parent window, the child window of the IFRAME. Need friends can come to the reference, I hope to help you. In web development, often use IFRAME, inevitably encounter the need in the parent window to use the elements in the IFRAME, or in the IFRAME frame using the par
Example
$ (window.frames["iframe1"].document). Find ("input[@type = ' Radio ']"). attr ("Checked", true);
Action in IFRAME Select all radio buttons in the parent window
$ (window.parent.document). Find ("input[@type = ' Radio ']"). attr ("Checked", "true");
Of the IFRAME framework:
Get an IFRAME child page element on the parent pageThe code is as follows:
A later test of a project found that the browser memory remains high, and the more the iframe page is opened, the larger the memory usage, especially in the IE browser series, I will share with you the following: I recently participated in the development of an iframe dynamic creation and memory release project. Because the project is a browser-based fat client (RIA) application,
In this paper, we analyze the common methods for jquery to obtain elements in IFRAME. Share to everyone for your reference, specific as follows:
jquery obtains several methods of elements in an IFRAME:
To get the parent page element in an IFRAME child page
The code is as follows:
Copy Code code as follows:
$ (' #objId ', parent.document);
Ge
Reference | Reference manual
I Element | I object IMG Element | IMG Object DHTML ObjectIFRAME Elements | IFrame Object--------------------------------------------------------------------------------Create an inline floating frame.Member tableThe following table lists the members that the IFrame object leads to. Click the tab on the left to select the type of member you want to view.Label Properties/Properti
The first thing to say is that Ajax is unable to implement the upload file, you can think of Ajax and background communication is passed through the string, how can pass the file? In fact, for security reasons JS is unable to manipulate the file, so do not say with Ajax to implement the file upload, it is impossible.In this paper, the implementation of the file upload is no page refresh, can be said to be an "Ajax-like" approach.Before starting to say a few words, in fact, before the advent of A
jquery Method:
To get the parent page element in an IFRAME child page
The code is as follows:
The code is as follows
Copy Code
$ (' #objId ', parent.document);
Get...
Get an IFRAME child page element on the parent pageThe code is as follows:
The code is as follows
Copy Code
$ ("#objid", Document.frames (' Iframename '). Document)$ (docum
Using an IFRAME on a page to dynamically load page content is a more common method of Web page development. Gives an IFRAME without a scrollbar in the parent page, and then assigns a loadable page to the attribute src so that when the parent page is accessed, the subpage can be loaded automatically. The height of the IFRAME needs to be adjusted based on the actua
Dom Method:Parent window Operation iframe:window.frames["Iframeson"].documentIFrame Operation parent window: window.parent.documentjquery Method:Action in the parent window selects all input boxes in the IFRAME: $ (window.frames["Iframeson"].document). Find (": Text");Action in IFRAME selects all input boxes in the parent window: $ (window.parent.document). Find (": Text");Html:
1. Select all radio buttons
Document directory
All the attributes of Firefox iframe:
All iframe attributes of IE6
All iframe attributes of IE8
Highly adaptive problems
Access the home page through iframe
Iframe is a very useful tag. If you do not use it to model Ajax effects in the early days,
Iframe is generally used to include other pages. For example, we can load the content of another website on our own website. For better results, iframe may need to be transparent, so you need to know more about the iframe attribute. Here we will simply sort it out to make it easy for you
1. iframe definition and usageT
One, iframe blocking onload Window onload event to wait for all content on the page to load complete, including all the IFrame loading is completed before it will run, so it will give users a great "misunderstanding", in case the IFrame loaded too slow, it will make users feel the site is slow. Solution: Use JavaScript to dynamically assign values to the
jquery Tutorials In web development, an IFRAME is often used, and it is unavoidable to encounter elements in the IFRAME that need to be used in the parent window, or to use the parent window in the IFRAME frameworkJsGets the elements in the IFRAME in the parent window1.Format: window.frames["The name value of the
In the project often want to dynamically add an iframe, and then to the added IFRAME to do related operations, and sometimes encounter an iframe loading is slow what reason, how to solve it? Take this question together through this article study, seek the answer!
Aaa.html
Bbb.html
Problem:
Execution of the above aaa.html found that t
We've been trying to keep up with the latest trends in the lead, and today we found a very interesting thing that either we didn't see or just happened. We can only say that this is a new discovery.
We all know about the IFRAME injection attack, right?
Understanding an IFRAME Injection
Today's IFRAME is a very standard HTML tag, and it's a simple way to embed
We often have the parent page and the IFRAME page operation, such as
The contents of this iframe are JS written. such as the following code
var iframe = document.getElementById ("iframe"),
doc = iframe.contentWindow.document;
Doc.open ();
Doc.write ("---------something------");
Doc.close ();
The code
How to operate the iframe , 1. Control the JS code outside the iframe inside the iframe . 2. Act on the parent frame to the child iframe.Get the content in the IFRAMEThe main two APIs are Contentwindow, and Contentdocument Iframe.contentwindow, which gets the window object iframe.contentdocument of the IFRAME, The two
The IFRAME child page communicates with the parent page depending on whether the SRC attribute in the IFRAME is linked by domain or cross-domain, and the mode of communication is different.
I. Communication of parent-child pages under the same domain
Parent page parent.html
Copy Code code as follows:
Sub-page child.html
Copy Code code as follows:
Method
:)
Wzhiyuan (who I am) in 2005-7-12 22:06:24
Iframeid.location=newurl
Kendo7 at 2005-7-12 22:40:56
Qidizi (Qidizi) at 2005-7-13 1:10:27
Document.frames[0].location.href =url;
Net_lover (Mencius e chapter) in 2005-7-13 7:56:10
window.frames["Iframename Property"].location.href= "Xxxx.asp"
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.