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
How to hide Menu Bar in Page Load Using JavaScript?
Please help me…………
mhossain said this on September 24, 2006 at 3:10 pm |
its not working in IE…..pls help me
ramana said this on September 29, 2006 at 8:22 am |
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…
Rahmansaher said this on October 4, 2006 at 5:41 pm |
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.
ben said this on December 16, 2006 at 2:13 pm |
All about arm clock http://timex.ifastnet.com
natshiz said this on January 15, 2007 at 12:50 pm |
to hide menu bar make menubar=no
spurti said this on February 17, 2007 at 3:22 am |
hide address bar, standard buttons bar and other bars at the browser when the opening of the page useing java script.
Joshi Pattabhi said this on July 24, 2007 at 4:06 am |
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!
Mark said this on September 25, 2008 at 9:18 am |
how to hide address bar of your browser by javascript (the browser is opened by window.open() )?
atul said this on December 2, 2008 at 4:26 am |
it is not working in firefox…..can any one help me…
raju said this on April 14, 2009 at 12:20 pm |
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.
blalhalhahh said this on July 14, 2009 at 9:17 pm |
if (this.name!=’fullscreen’){
window.open(location.href,’fullscreen’,’fullscreen,scrollbars’)
}
^ this opens page fullscreen IE. what i will use for kiosk.
blalhalhahh said this on July 14, 2009 at 10:30 pm |
thanks.it worked for me
Saurabh said this on February 4, 2010 at 6:54 am |
Not working in Firefox
Niraj Phalke said this on March 23, 2010 at 9:59 am |
i think its not working, i’ve tried ur code
uDjo said this on January 20, 2011 at 1:28 am |
its not working
Abid Husain said this on June 12, 2011 at 7:17 am |
great info for me 😀
eko susilo said this on August 25, 2011 at 8:58 pm |
ya its not working for me as well
-Shweta
Shweta said this on September 8, 2011 at 6:03 am |
will it work for IE9 also.. pls help me.. its not working for me with IE9..
Raja said this on October 5, 2011 at 9:56 am |
will it work for IE9 also.. pls help me.. its not working for me with IE9..?
Raja said this on October 5, 2011 at 9:57 am |
You’re awesome. Thank you!!
monica said this on November 23, 2011 at 8:56 pm |
Wow man! You are the best this is the code i was exactly looking for… MAN YOU ARE NO. 1 !!!!! keep it up boss…
Dean Karl said this on December 11, 2011 at 9:39 am |
not working
jg said this on April 27, 2012 at 7:35 am |
not working
ankush said this on June 29, 2012 at 10:38 am |
I tried you demo URL amd it doesn’t work on any browser for me.
steve said this on July 6, 2012 at 1:58 pm |
can i automatically close previous page without windows feature?if yes then how
raza said this on July 17, 2012 at 3:47 am |
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 !
bhanu said this on July 24, 2012 at 1:20 pm |
Did u find any solution
Dimps said this on March 20, 2013 at 9:02 am |
878487
+989+ said this on December 1, 2012 at 12:01 pm |
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+
suren said this on April 15, 2013 at 6:13 am |
I need the code, the link mentioned above does not provide the code…can anyone help?
Abhijit said this on May 29, 2014 at 10:03 pm |
It works, thanks
Abu Shoeb said this on July 31, 2014 at 10:04 pm |
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.
al said this on June 28, 2015 at 2:07 pm |