javascript: can remove the toolbars from the main browser window??

Hi

I want to remove the toolbars from the main browser window. Is That possible?

If that is possible, please provide the code. ( I will add an extra 250 points to whoever supplies the correct code)


Thanks!!!
LVL 1
vanaudenAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

archrajanCommented:
<script language="JavaScript"><!--
if (history.length != 1) {
    window.open(location.href,'main','fullscreen=yes,outerHeight=' + screen.availHeight + ',outerWidth=' + screen.availWidth);
    setTimeout('self.close()',1000); // close self after a seconds delay
}
0
archrajanCommented:
if(document.location.search=='')  {
 newwin=window.open(document.location + "?newwin=true", name, "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,directories=no,location=no,width=" + width + ",height=" + height + ",left=" + left + ",top=" + top);
 self.close()
}
0
archrajanCommented:
with style you can hide scroll bars just add in the body <body style="overflow:hidden;">
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

vanaudenAuthor Commented:
I will get back to this in about 4 hours after checking the code and doing some other stuff like feeding myself. ;-)   Thanks!
0
archrajanCommented:
specify the height and width and other properties i my second comment and call it on body onload
var height = 600                    
var width = 600            
var name = "nameofthewindow"            
var top = 20
var left = 20                            
0
archrajanCommented:
0
vanaudenAuthor Commented:
Hi archrajan

Is it possible to maximise the window in this script, instead of specifying a size??

0
archrajanCommented:
yeah it is...possible
0
archrajanCommented:
<script language="JavaScript"><!--
if (window.screen) {
    window.moveTo(0,0);
    window.outerHeight = screen.availHeight;
    window.outerWidth = screen.availWidth;
}
//--></script>
0
vanaudenAuthor Commented:
Thank you, but I do not know javascript very well, could you integrate that into your current code as below, I have again increased the points... to 500:

<script language="JavaScript">
function newpage() {
      if(document.location.search=='')  {
            var height = 700                  
            var width = 1013          
            var name = "nameofthewindow"            
            var top = 0
            var left = 0    
             newwin=window.open(document.location + "?newwin=true", name, "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,directories=no,location=no,width=" + width + ",height=" + height + ",left=" + left + ",top=" + top);
             self.close()
}
</script>
0
archrajanCommented:
script language="JavaScript">
function newpage() {
     if(document.location.search=='')  {
          var height = 700                  
          var width = 1013          
          var name = "nameofthewindow"            
          var top = 0
          var left = 0    
           newwin=window.open(document.location + "?newwin=true", name, "fullscreen=yes,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,directories=no,location=no,width=" + width + ",height=" + height + ",left=" + left + ",top=" + top);
           self.close()
}
</script>


try this..
0
archrajanCommented:
and u need not specify the width and height then
0
archrajanCommented:
see this for reference
The Javascript open function does not support opening new windows maximized, but it does support opening opening windows at a certain size. The problem being that Netscape and Internet Explorer do this differently and not all versions of all the browsers support the sizing on the open command so we need to double up and resize the window again once its opened.
This function accepts a URL to display in the window and the logical name of the window, if a window with that logical name is already open it will be brought to the front. The function returns the handle to the window.

function f_open_window_max( aURL, aWinName )
{
   var wOpen;
   var sOptions;

   sOptions = 'status=yes,menubar=yes,scrollbars=yes,resizable=yes,toolbar=yes';
   sOptions = sOptions + ',width=' + (screen.availWidth - 10).toString();
   sOptions = sOptions + ',height=' + (screen.availHeight - 122).toString();
   sOptions = sOptions + ',screenX=0,screenY=0,left=0,top=0';

   wOpen = window.open( '', aWinName, sOptions );
   wOpen.location = aURL;
   wOpen.focus();
   wOpen.moveTo( 0, 0 );
   wOpen.resizeTo( screen.availWidth, screen.availHeight );
   return wOpen;
}
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
archrajanCommented:
let me know if u need something else.. i can help u with
0
vanaudenAuthor Commented:
Hi archrajan

Thank you very much for your patience and help!

This is exactly what I need!!!

Have a great day!

Ian
0
archrajanCommented:
Glad that i could help
Thanks for the grade and points
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.