Forum Moderators: open

Message Too Old, No Replies

Popup window is getting minimized

Popup window is getting minimized

         

sreenath205

9:28 am on Mar 7, 2005 (gmt 0)



Hi

I have a main window with a button and when i click on it it opens another window, after which i have given an alert message when this alert comes the popup window gets minimized.How to stop this?

This is my code

Code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
<title>Untitled</title>
</head>
<script language="javascript">

function test(){
var win=window.open();
alert("hi");
}
</script>

<body>
<form name=f1>

<input type="button" value="click" onClick="test()">

</form>
</body>

</html>

When the alert "hi" comes the window which is opened gets minimized .How to stop that

Thanks
Sreenath

Bernard Marx

9:37 am on Mar 7, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Re-focus pop-window

function test(){ 
var win=window.open();
alert("hi");
win.focus();
}

Maybe better: Launch alert from pop window

function test(){ 
var win=window.open();
win.alert("hi");
}