How to make when I open pop up window and close to say message Want close... this code work on main page but I need to close external page... What I need to fix in this code. Thanks...
<script>
function openwindow(){
window.open("http://www.google.com","mywindow","menubar=1,resizable=1,width=550,height=550");
}
</script>
<p>
<A href="javascript: openwindow()">Open Window</A>
</p>
<script type="text/javascript">
window.onbeforeunload = function () {
return "Want Close?";
}
</script>
You can't make this work.
When the user opens a new window, you basically don't have control over it, instead you host it ( can modify the content ) on your own.
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.