Click to See Complete Forum and Search --> : Removing menubar etc
lentin
12-15-2003, 08:46 AM
I have a window that opens from the server. Is there any way that I can remove the menubar etc either onload or after it has loaded. I can do resizeTo and moveTo but I don't know how to get rid of the rest, and I've got a really bad headache.
batfink
12-15-2003, 01:06 PM
No is the long answer!:rolleyes:
You will have to define the window controls/display before it is opened. Trick/cheat and open a new window with the features you want and close the original page that opened it and it will appear only one window was ever involved.
<html>
<body>
<SCRIPT LANGUAGE="JavaScript1.2">
myWindow = window.open("", "tinyWindow", 'toolbar=yes,width=250,height=100');
myWindow.document.write("Welcome to this new window!");
myWindow.document.bgColor="lightblue";
myWindow.document.close();
self.opener=null;
self.close();
</script>
</body>
</html>
requestcode
12-15-2003, 01:56 PM
These two lines are interesting in that they keep the message from poping up asking you if you want to close the parent window. I had never seen that before. Does it work in all browsers or just IE?
self.opener=null;
self.close();
requestcode
12-15-2003, 02:00 PM
Okay - I answered my own question. It does not work in Mozila based browsers.
batfink
12-15-2003, 04:18 PM
Try:
return false;
lentin
12-16-2003, 04:16 AM
Thanks very much. Really appreciated.
ps. Where would I put
return false
????::D
lentin
12-16-2003, 05:16 AM
Could you please tell me what I have done wrong.
If you go to www.lentin.freeuk.com
click evaluate site, go to "Booking" and submit the form, you will see what is happening.
If you don't want to do that then I will tell you.
When you press submit, the tinywindow form opens, opens thankyou, then closes itself and the site, which I don't really want.
Thanks again in advance
batfink
12-16-2003, 05:34 AM
Hi Lentin, I have had a look at your site and cannot find the code that opens and closes the window. (maybe because you have server side code in there which does not show up).
I guess you may have implemented the suggested code wrong. But as I cannot see where you have put it I cannot say what to do. Please post the code, or PM me for privacy if you wish.
batfink
12-16-2003, 05:37 AM
The code I need to see is in http://www.lentin.freeuk.com/othankyou.html
which is your serverside code (CGI) this is your redirect page.
batfink
12-16-2003, 05:51 AM
Ok, I have just found the page in my cache. I believe that both pages are closing because:
The calling page is told to close and it is.
The new thankyou page is not having enough time to be created/opened before the page spawning it is closed hence it dies as well.
Also you seem to have opened the page twice??
<HTML>
<HEAD>
<TITLE>js array</TITLE>
<script language="JavaScript">
window.open("thankyou.html","thanks","height=300,width=300,resizable=0")
self.close
</SCRIPT>
</HEAD>
<BODY>
<script language="JavaScript">
window.open("thankyou.html","thanks","height=300,width=300,resizable=0")
self.opener=null;
self.close();
</SCRIPT>
</body>
</HTML>
So first make sure there is one call only.
If that fails put in a delay:
<script language="JavaScript">
window.open("thankyou.html","thanks","height=300,width=300,resizable=0");
setTimeout("parentClse()", 150);
function parentClse()
{
self.opener=null;
self.close();
}
</SCRIPT>
lentin
12-16-2003, 06:12 AM
Thanks for the quick response.
I removed one of the calls, firstly out of the head, that didn't work so I then removed it ouf of the body and that didn't work.
I then used your alternative in the head and that doesn't work either.
What is happening is that the parent "othankyou" is now not closing. Also when I close "thankyou" it is meant to go back to "booking" which it does, but it stays the same size. How I I get it to revert to the full page again.
lentin
12-16-2003, 06:51 AM
<HTML>
<HEAD>
<TITLE>js array</TITLE>
<SCRIPT language="JavaScript">
window.open("thankyou.html","thanks","height=300,width=300,resizable=0");
setInterval(self.close,500);
</SCRIPT>
</HEAD>
<BODY>
</body>
</HTML>
Using the above closes the parent window , but I then get a prompt asking if I want to close the window. Is there any way to get rid of the prompt., or is this not the way to go????
batfink
12-16-2003, 03:09 PM
This line stops the question / prompt from appearing:
self.opener=null;
so with the last code you pasted u now have:
setInterval(self.opener=null;self.close,500);
What code do you have to say go to the booking page?
Is it simply a url or is it another window.open()
lentin
12-16-2003, 04:31 PM
Hi,
It's just a URL to the booking page. I don't how or where to put window open which I know is what I need as I have to resize the booking window.
Thanks for the last bit by the way.
batfink
12-17-2003, 10:16 AM
where you declare the url (example)
target="booking.html"
put in its place:
target="javascript:window.open('booking.html','','')"
Note double quotes " on the outside the rest are single quotes '
Do not declare a size for the new window yet, see if it opens to proper size on its own first.
lentin
12-17-2003, 11:31 AM
You're a star Batfink. I'll try that and get back to you if it doesn't work, or I have any more probs.
Thanks again
lentin
12-17-2003, 11:39 AM
Just tried it - works great. Thanks a million