Click to See Complete Forum and Search --> : Need to close window, suppress error message and maximize new window
kdorrick
10-25-2003, 09:47 PM
Hi,
I have a frame page and I need to open a page to fully cover the page after information is submitted. Since the page opens up under the top frame with just using the window.open or response.redirect method I did the following
window.parent.close();
window.open("http://www.blah.asp","","width=" + "(screen.width)+" + "," + "height=" + "(screen.height)+" + "," + "top=" + 0 + "," + "left=" + 0)
The two propblems I get are:
1. IE sends a message prompting me whether or not to actually close the window
2. The new window does not maximize
Any advice?
Thanks!
Your first problem can be gotten through, but I am quite reluctant to say anything about it...
Your second problem is in the code:
window.open("http://www.blah.asp","blah","width="+ screen.width+",height="+screen.height+",top=0,left=0");
[J]ona
kdorrick
10-25-2003, 10:35 PM
Hey, Jona!
Thanks. I also want to get the toolbar/menu back in there and tried toolbar = true as one of the parameters, but it did not work, although no errors returned.
Regarding the IE message on the window.close()- I am wondering why it produces the error message on one page, but never gives me the error on another page I'm using it on. And there don't seem to be too many differences in the pages either, both asp with javascript.
Also, what web site do you recommend for good tiny calendar applets?
Karen
Use toolbar=yes,menubar=yes,scrollbars=yes etcetera in the width and height parameter area.
As for IE's window.close() JavaScript is supposed to only be able to close windows that it opened. If JavaScript did not open the window, it should not be able to close it.
Calendar applets? Applets usually tend to make a page "ugly," and you will need to provide an alternative for users that do not have Java anyways, so I would suggest a server side answer to your calendar request first, and then suggest a client-side one afterwards. But I cannot think of any calendar applets off of the top of my head, as I do not deal with actual Java coding often, sorry.
[J]ona
this works in IE 6 and Netscape 7 (the latter only if not locally stored on HD)
</head>
<script language="JavaScript">
<!-- Hide script from old browsers
function newWindow() {
breedte = screen.width - 10;
hoogte = screen.height - 50;
extra = "toolbar=0,width=" + breedte + ",height=" + hoogte + ",top=0,left=0";
selfportrait = window.open("afront.html","naam",extra);
}
window.opener=top;
window.close();
// End hiding script from old browsers -->
</script>
<center>
<h2><u>Welcome to Michèle Costa's site</u></h2> <br><br>
the following pages require <b>JavaScript</b><br><br>
and <b>Allow Popups From This Site</b> (see TOOLS menu)
<body onLoad="javascript:newWindow()">
</body>
</html>