Key points of knowledge1:document.getelementbyid ("II"). After Contentwindow gets the IFrame object, it can get the Window object containing the page through Contentwindow. The page elements can then be accessed normally;2:$ ("#ii") [0].contentwindow if the IFRAME is obtained with the jquery selector, a "0" is required;3:$ ("#ii") [0].contentwindow.$ ("#dd"). Val () can then use the jquery selector to perfo
Several methods for obtaining elements in IFRAME through query
Obtain the elements of the parent page on the IFRAME subpageCodeAs follows:$ ('# Objid', parent.doc ument );// Get it done...Obtain the element of the IFRAME subpage on the parent page.The Code is as follows:$ ("# Objid", document.frames('iframename'assist.doc ument)
Certificate (document.ge
1. js how to determine whether in the IFRAMEJS Code
Way One
if (self.frameelement self.frameElement.tagName = = "IFRAME") {
Alert (' in IFrame ');
}
Way Two
if (window.frames.length! = parent.frames.length) {
Alert (' in IFrame ');
}
Mode three
if (self! = top) {
Alert (' in IFrame ');
}
1. What is an IFRAME?
The IFRAME closing tag creates an inline frame that contains another document, which can be placed between the IFRAME for browsers that do not support IFRAME.
The role of 2.iframe
(1) Download of file (attachment) via
Use the Bootstrap framework to pop up the iframe page. In the pop-up mode box, the manned iframe page, bootstrapiframeHTML code:
Js Code:
$(function(){ $("#btnclick").click(function(){ var frameSrc = "../ErrorPages/NoPermission.html"; $("#NoPermissioniframe").attr("src", frameSrc); $('#NoPermissionModal').modal({ show: true, backdrop: 'static' }); });});
:
If a jsp page
Below is the case of an internal iframe looking for external mainFrame var Websitesearchbutton = window.parent.parent.document.getElementById (' MainFrame '). ContentWindow.document.getElementById ("Webresource-search-button"); In the IFRAME1, sub-page to find the elements of the page$ (window.parent.document). Find (ID);2. Parent Page---> sub-page$ (ID). contents (). Find (Element ID). FIND (element ID);3, sub-page---> Grandfather's page$ (window.top
Iframe adaptive height and iframe adaptive
Iframe needs to be used in the project process, but if the height of iframe is written to death, the page height corresponding to it must be fixed, so it cannot adapt to page content changes and is not flexible, therefore, the following method is written to determine the heigh
1. Introduction to Layer
Layer is a jquery pop-up layer plug-in that is very convenient to use and powerful, and has good compatibility with various browsers. You can use it to create Web applications with better interaction experience.Program.
Layer maintenance personnel are similar to small G and passionate front-end developers, so you don't have to worry about its upgrade.
Official website of layer: Demonstration and explanation of Layer
2. layer usage
(1) download the latest layer
HTML code:JS Code:$ (function () { $ ("#btnclick"). Click (function () { var framesrc = "). /errorpages/nopermission.html "; $ ("#NoPermissioniframe"). attr ("src", framesrc); $ (' #NoPermissionModal '). Modal ({show:true, backdrop: ' Static '});}); Embedding a JSP page in the IFRAME requires a div layer to be popped out of the IFRAME, but this div cannot go beyond the scope of th
Recently in the use of Webdriver Crawler, encountered the site of the IFRAME, processing a long time no solution, and later found that the original Webdriver processing methods, ashamed.1, the IFRAME has the ID or name of the caseEnter the id= "FRAME1" frame and locate the id= "Div1" div and the input box id= "INPUT1".Dr.switchto (). FRAME ("frame1");Dr.findelement (By.id ("Div1"));Dr.findelement (By.id ("I
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
Method 1
"FSO function:"-"Disable site Fso function ". disable the fso function of the site. in this way, the current asp Trojan can be eliminated. if you want to upload an attachment. you can use "SAFileUp ". "aspupload ". and other components.
Method 2
A website that has worked so hard is suddenly infected with Trojans. The reason is that the webpage is infected with viruses. When the code is opened, it is found that the last line of code on all pages has an additional sentence:
Reference cont
How do you control the inline iframe scrolling in the page? method is to use the scroll method of the iframe window, you can refer to the following example How do you control the inline iframe scrolling in the page? The method is to use the scroll method of the iframe window:nbsp; nbsp; 1, get the Window object of the
If your site does not support HTTPS, you can use Baidu cloud acceleration or other services of the same type, open HTTPS
Title
Content
Type
General
Support layout
Responsive, fixed-height, fixed
The required script
No
Sample
Basic Use
allowFullScreen
Srcdoc= "
Src= "Http://m.baidu.com"
Sandbox= ""
allowFullScreen
Width= "400"
height= "300"
Allowtransparency= "true" >
Add layout (Fixed-height for example)
Mode one if (self.frameelement self.frameElement.tagName = = "IFRAME") {alert (' in IFRAME ')}//Mode two if (Window.fram Es.length! = parent.frames.length) {alert (' in IFrame ');}//Way three if (self! = top) {alert (' in IFrame ');} first, find parent page element in IFRAME
Iframe usage, iframe usage
1. The parent page calls the child page element.
$('a').contents().find("b")
(A indicates the id or class of iframe, and B indicates the sub-page)2. The child page calls the elements of the parent page
$(window.parent.document).contents().find("c")(C represents any element id or class of the parent page) 3.
Many times we need the IFRAME to adapt the loaded page height without the iframe scroll bar, but this time I need the page does not need scroll bar and iframe to scroll bar, and the IFRAME automatically follow the window size changes, adaptive page size. Here is the code, next time to explain the code.$ (document). Rea
Iframe is often used in web development, it is inevitable that elements in iframe need to be used in the parent window, or elements in the iframe framework that use the parent window can be obtained in the parent window in the element format of iframe: $ ( quot; # iframe ID
How to handle Iframe and nested Iframe and webdriveriframe in WebDriver
Recently, when I used webdriver for crawling, I encountered an iframe problem on the website. After a long time, I did not solve the problem. Later I found that the webdriver had its own processing method, and I felt ashamed ..
1. If iFrame has an
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.