Hiding Address Bar on Page Load Using JavaScript

 Today , I was playing around of ways of how you can Hide an Address/Tool Bar on a Page Reload. I looked at couple of solutions on the net but nothing seems to be available for IE and Firefox working together. Then I figured it out a way to work it out for both. This is the code I used, to solve my problem.     
 
[js]

function openWindow(){
var browser=navigator.appName;
if (browser==”Microsoft Internet Explorer”)
{
window.opener=self;

}
window.open(‘filename.htm’,’null’,’width=900,height=750,
toolbar=no,scrollbars=no,location=no,resizable =yes’);
window.moveTo(0,0);
window.resizeTo(screen.width,screen.height-100);
self.close();
}

[/js] 


[html]

If the window does not open, please turn off the pop-up blocker for this site and click"> here

[/html]
Basically , its invoking two functions when the page is being loaded.
--This will take care of closing the browser in Firefox:v>onload=“window.open(‘’,’_parent’,’‘);openWindow()”> If you simply use the this line onload="openWindow()"  , then the window will not close automatically in Firefox  

 

Edit : A lot of people are having problem implementing this code, may be because of the quote not displaying correctly. To make the life little easier, I have zipped up the code and can be dowloaded from HERE

You can Also Demo it at  http://rahmansaher.com/poper.html

~ by rahmansaher on August 10, 2006.

33 Responses to “Hiding Address Bar on Page Load Using JavaScript”

  1. How to hide Menu Bar in Page Load Using JavaScript?
    Please help me…………

  2. its not working in IE…..pls help me

  3. Can you please tell me of what its not working and how are you placing you code. Make sure you replace the filename.htm to the filename of your pop up page…

  4. Dude. This is awesome! I think the problem other people were having is that the quote marks in your code need to be replaced with ‘ and “. For some reason, they are italicized in your code and will not work.

  5. All about arm clock http://timex.ifastnet.com

  6. to hide menu bar make menubar=no

  7. hide address bar, standard buttons bar and other bars at the browser when the opening of the page useing java script.

  8. Nice work mate. Solves my problem of letting
    people know where I have stored a web page on a public shared drive at work. Thanks!

  9. how to hide address bar of your browser by javascript (the browser is opened by window.open() )?

  10. it is not working in firefox…..can any one help me…

  11. don’t work in firefox, or so i’ve read while searching for this solution. I’d only use it for a kiosk application, or for certain popups, wouldnt put it online within main page.

  12. if (this.name!=’fullscreen’){
    window.open(location.href,’fullscreen’,’fullscreen,scrollbars’)
    }

    ^ this opens page fullscreen IE. what i will use for kiosk.

  13. thanks.it worked for me

  14. Not working in Firefox

  15. i think its not working, i’ve tried ur code

  16. its not working

  17. great info for me 😀

  18. ya its not working for me as well

    -Shweta

  19. will it work for IE9 also.. pls help me.. its not working for me with IE9..

  20. will it work for IE9 also.. pls help me.. its not working for me with IE9..?

  21. You’re awesome. Thank you!!

  22. Wow man! You are the best this is the code i was exactly looking for… MAN YOU ARE NO. 1 !!!!! keep it up boss…

  23. not working

  24. not working

  25. I tried you demo URL amd it doesn’t work on any browser for me.

  26. can i automatically close previous page without windows feature?if yes then how

  27. i want to hide menu bar and addressbar for current webpag using java script and that has to happen while loading the page it self with out using window.open() method.

    thanks in adavance !

  28. 878487

  29. Now in modern browser, simply location=no doesn’t hide the address bar. It simply make read only. Any Other Solution to make hide the address bar please. I am testing in IE7+

  30. I need the code, the link mentioned above does not provide the code…can anyone help?

  31. It works, thanks

  32. Can someone tell me what code to use to auto-hide the address bar in Chrome? And then make it reappear when I hover my mouse over the area where its supposed to be? Thanks.

Leave a reply to steve Cancel reply