简体   繁体   中英

Action On Popup Window Close

Parent Html Code 1.html

<a onClick='window.open("1.php","Page","menubar=no, status=no, scrollbars=no, menubar=no, width=200, height=100");return false;'>

1.php code:

echo '<script type="text/javascript">window.close();</script>';

Required: On closing of popup done by "window.close();", i need to send ajax request from 1.html. how can we do it ?

You can call any JavaScript function in the parent window, like this in the .php HTML:

window.opener.functionNameOfTheOpenerWindow();

Read more here http://www.w3schools.com/jsref/prop_win_opener.asp

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM