Solutions to wBox iFrame callback close Problems

Source: Internet
Author: User

Recently, many people who use my jQuery pop-up box plug-in wBox have asked me about wBox closures. For example, a page uses wBox iframe to access a page, which is used for user login, after successful login, wBox is closed. In fact, the method of implementing callback to close wBox is very simple, that is, using the iframe DOM operation. For example, we write the code like this:

// Assign a value to wbox and close it using the close method of the wbox object.
Var wbox = $ ("# iframe"). wBox ({
RequestType: "iframe ",
Target: "B .html"
});

So we entered the User Token verification in page B .html. If the verification succeeds, we can use parent. wbox. close () in B .html to close it. Just like the following code, iframe can be closed after the verification is completed and closewBox is run:

Function closewBox (){
Parent. wbox. close ()
}

For DOM operations between the iframe subpage and the parent page, refer to the document "using JavaScript to perform DOM operations for iframe in IE and Firefox.

Source: http://www.js8.in/620.html

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.