Home > Web Front-end > JS Tutorial > JQUERY code to set the SRC value of IFRAME_jquery

JQUERY code to set the SRC value of IFRAME_jquery

WBOY
Release: 2016-05-16 18:15:03
Original
1070 people have browsed it
Copy code The code is as follows:

$(window.parent.document).find("#Frm_Main" ).attr("src",url);


Use jquery to operate iframe

1 There are two ifames in the content



jQuery in leftiframe changes the src code of mainiframe:
$(" #mainframe",parent.document.body).attr("src","http://www.jb51.net ")

2 If there is an ifame with the ID of mainiframe in the content
< ;iframe id="mainifame"...>
ifame contains a someID
you want to get this content

Get the contents of someID

$("#mainiframe").contents().find("someID").html() html or $("#mainiframe").contains().find("someID ").text() value

2 As shown above
jQuery in leftiframe operates the content of mainiframe and the content of someID
$("#mainframe",parent.document.body).contents ().find("someID").html() or $("#mainframe",parent.document.body).contents().find("someID").val()
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template