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