Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting window properties on load 1

Status
Not open for further replies.

DeltaTech

Programmer
Apr 16, 2003
92
MY
Hi
Does anyone know how to set a window's properties (size/scrollbar/title/locationbar/etc) on load? I know we can set resizeTo but how do I set the other properties as well. Also, I know we can set the properties if we are poppin up another window through Javascript. What I want to do is set the current window's properties, after it has loaded. My intention, basically is to hide the location of the page (" from the visitor as well as size the window to a particular size and if anyone knows how to do that, it would be very helpful. Note that the visitor is coming from a different site than the page that is loading, so to code the javascript into the link might not be possible.
Anyone, please?
[bigcheeks]
 
You could open it in a new window using the Window.Open and hide the address bar, but someone could hit "Ctl" & "N" on their keyborad and open it in a totally different window showing the address.

Huh..I guess in short I really don't know. LOL

Rob
Just my $.02.
 
Hi rtshort
Yes, the user can hit "Ctrl" + "N" to get a new window, but my thinking is that if the script is within the page itself, it will set all the relevant properties and remove the location bar as well.
[bigcheeks]
 
Hi robertdonofrioUWF
Thanks for the pointer. I have searched but never found a list that is as comprehensive as that.
I have tried setting the properties in the onLoad event, but it does not seem to be firing. Code is as follows:

<html>
<head>
<title>Set window properties</title>

<script language=&quot;Javascript&quot;>
function setWindow()
{
window.locationbar.visible = false;
window.menubar.visible = false;
window.personalbar.visible = false;
window.scrollbars.visible = false;
window.statusbar.visible = false;
window.toolbar.visible = false;
window.focus();
}
</script>


</head>
<body onLoad=&quot;Javascript:setWindow();&quot;>


Any idea what I am doing wrong or how I can fire it each time the window loads? Perhaps Window onLoad might be better, but I do not know where to call it from or how to call it.
Much appreciated.
[bigcheeks]
 
Yes you cant modify (at least as i knw till now) the windows visual properties of the parent window only on the child window(ie window.open...)
As for the code above some of the properties or methods are only for Netscape as it says there.

________
George, M
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top