For example, qq login (qzonestyle.gtimg.cnqzoneopenapijs-sdk-demo.html), click the qq login button on the page. The new qq logon window B is displayed. After the mobile phone is scanned, the B window is closed and the retFun function in. How is this done? Such as QQ login (http://qzonestyle.gtimg.cn/qzone/openapi/js-sdk-demo.html), in A page Click qq login button, pop up new qq login window B, mobile phone scan after login, B window closed, and call the retFun function in window.
How is this done?
Reply content:
Such as QQ login (http://qzonestyle.gtimg.cn/qzone/openapi/js-sdk-demo.html), in A page Click qq login button, pop up new qq login window B, mobile phone scan after login, B window closed, and call the retFun function in window.
How is this done?
Window A opens window B, so window B haswindow.opener(Window. open or href opens, and IE only opens through window. open) points to window.
A
// Window. open (B); // open window B function test () {alert (1 );}
B
window.onbeforeunload = function() { if (window.opener) { window.opener.test(); }}
Note: The server environment is required.
For more information about cross-window/Document Communication exceptions, seepostMessageInformation
For how to scan the QR code to log on to the webpage, see scan the QR code. How do you contact the two events?
This must be A notified by the server and called by A. As for how the server notifies A, there are A lot of technologies. Just check it. It is certainly not the called in the B window.