Click to See Complete Forum and Search --> : How to hide the menubar/toolbar/locationbar/statusbar of an existing window?
AnuAbraham
June 13th, 2003, 05:58 AM
I want to hide menubar/toolbar/locationbar/statusbar of an existing window .In NN6 it is possible by
netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserWrite');
window.menubar.visible = true;
window.toolbar.visible = false;
window.locationbar.visible = false;
window.statusbar.visible = false;
window.linkbar.visible = false;
How do you do that for IE6
Please let me know the solution.
Thanks
ANU
Vanny
June 15th, 2003, 11:35 PM
I have had a similar problem and couldnt find an easy solution to it.
How i got around this is to reopen the page in a new window with all the settings i wanted. I used some ASP to check if this had been done otherwise you would end up in an endless loop. Once the new window is open then close the current window.
This will also work in both Netscape and IE with having different code for each of them!!!
<% IF Request("reload") <> true THEN %>
function openWindow()
{
window.open("self.asp?reload=true","report","scrollbars=yes,resizable=yes,width=720,height=500,menubar=yes,status=no,location=no")
window.close()
}
<% END IF %>
<BODY onload="openWindow()">
AnuAbraham
June 16th, 2003, 11:49 PM
Thankyou Vanny.
I solved it to some extend.This is how 've done.
I didn't find any method to change the window properties when the window is opened and if one page has the required settings,the pages following with follow the same settings.
From a new page I am calling the required page and closing the parent window.
I made a copy of my login page say login.html.In the first page I gave the script:
<SCRIPT>
var w = screen.availWidth-10;
var h = screen.availHeight-10;
var p = window.self;
p.opener = window.self;
function Window()
{
if(info.indexOf("Netscape") != -1 )
{
netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserWrite');
window.menubar.visible = false;
window.toolbar.visible = false;
window.locationbar.visible = false;
window.statusbar.visible = false;
window.linkbar.visible = false;
return true;
}
if(info.indexOf("Microsoft") != -1 )
{
window.open("login1.html","_firstPage","width="+w+",height="+h+",left=0,top=0");
p.close();
return true;
}
}
</SCRIPT>
I am calling this function Window() On OnLoad() of login.html
Now it has a problem that if this page ,login1.html is called from any other page,the window is closing!!!
Forexample,after a person does logout,login1.html has to be shown ,here that window is being closed!!!!
Is there any solution for this?????
Moreover I cannot do this script on the same page because,the function has to be called on OnLoad() and it causes an infinite loop.Is there any method to call this Window() function only on the first loading????
U had written that u did the similar one using cookies,right? How do u do that?
Please comment on this
Thanks
ANU
Vanny
June 17th, 2003, 12:14 AM
Here is my exact script.
<SCRIPT LANGUAGE=javascript>
<!--
function arethedetailsthere()
{
var bSubmit = true
if(( document.loginform.username.value == "" ) || (
document.loginform.password.value == "" ))
{
alert("Please enter both a Username and Password")
bSubmit = false
}
if(bSubmit == true)
{
document.loginform.submit()
}
}
function formatPage()
{
<% IF request("reload") <> "true" then %>
var convene =
window.open("./login.asp?reload=true",'convene','scrollbars=yes,resizabl
e=no,width=720,height=580,menubar=no,status=no')
window.opener = top;
self.focus();
window.close();
convene.focus();
<% end if %>
}
//-->
</SCRIPT>
I fortunately had the option of using ASP and querystring as you notice my ASP tags <% %> checking if the page needs to be reloads, if so it shows the code if not it hides the code to stop the infinite loop.
If you dont have ASP then you may need to try and find a querystring analyser for HTML.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.