jquery parent page Face page sibling page call

Source: Internet
Author: User

The code used in the project is shown first so that it can be used later, and it will be understood directly.

var li_divs = parent.$ ("#servicelist") [0].contentwindow.$ ("#ccList. Li.div");
Li_divs.each (function () {
if ($ (this). Find ("a"). EQ (0). attr ("Attrid") ==$ ("#id"). Val ()) {
$ (this). Find ("a"). EQ (0). Text ($ ("#name"). Val ());
}
});

The following content is reproduced from

Key points of knowledge

1: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 perform the page operation after the window object of the IFrame is obtained;

4:$ ("#ii") [0].contentwindow.hellobaby= "DSAFDSAFSDAFSDAFSDAFSDAFSADFSADFSDAFSADFDSAFFDSAAAAAAAAAAAAA"; You can pass parameters to the IFRAME page in this way, you can get the value on the IFRAME page Window.hellobaby, Hellobaby is a custom variable;

5: In the IFRAME page through the parent can get the main page window, and then you can normally access the elements of the Father page;

6:parent.$ ("#ii") [0].contentwindow.ff; The sibling iframe is called between pages, need to get the Father's window first, and then call the same iframe to get the window to operate;

jquery parent page Face page sibling page call

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.