A summary of the method for jquery operation of JS function in IFRAME _jquery

Source: Internet
Author: User

This paper illustrates the method of jquery in the operation of the JS function in the IFRAME. Share to everyone for your reference, specific as follows:

1, jquery operation of the elements in the IFRAME (2 ways)

var tha = $ (window.frames["core_content"].document). Find ("#trewuuu"). html ();
var THB = $ ("#core_content"). Contents (). Find ("#trewuuu"). html ();

2, the operation of the parent interface elements (header: The ID of an element)

$ (' #header ', parent.document). Text ()

3. JS calls the JS function in the IFRAME (2 kinds)

window.frames["Core_content"].window.testiframe2 ("one");
document.getElementById ("Core_content"). Contentwindow.testiframe2 ("11");

4, jquery call the IFrame JS function (with parameters will have the return value)

$ ("#core_content") [0].contentwindow.testiframe2 ("11");

Precautions:

To be in the same domain name as the contained IFRAME (because the domain cannot be cross-domain)

More interested readers of jquery related content can view the site topics: "jquery operation iframe Tips Summary", "JQuery Extended Skills Summary", "jquery common Plug-ins and Usage summary", "jquery drag and drop effects and tips summary", "jquery Table" ( Table) Summary of operational techniques, "Summary of Ajax usage in jquery", "jquery common Classic Effects Summary", "jquery animation and special effects usage Summary" and "jquery Selector usage Summary"

I hope this article will help you with the jquery program design.

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.