Page 1 of 1

How to hide address bar with Javascript or PHP

Posted: Fri Mar 31, 2006 4:43 am
by madhu
HI

am using this code to open file filename.php

window.open("filename.php","_parent");

it will open filename.php with url http://hostname/filename.php in the addressbar.

now my problem is how to open that filename.php by hiding that url in the addressbar.(means that file should open without showing url in the addressbar)

any one plz help me in this regard.....

thanks in advance

madhu


feyd | Did this subject require yelling? I think not.

Posted: Fri Mar 31, 2006 4:49 am
by onion2k
http://msdn.microsoft.com/workshop/auth ... open_0.asp

Mind you, right click and View Page Info will reveal the URL..

Posted: Fri Mar 31, 2006 5:21 am
by madhu
hi i implemented like this

window.open("filename.php","_parent","name",'width=800,height=600,left=0,top=0,status=1,toolbar=0,fullscreen=1,location=0,menubar=0,titlebar=0');

but it is not working.

plz help.........

waiting for ur early replies...........

Posted: Fri Mar 31, 2006 5:37 am
by onion2k
madhu wrote:window.open("filename.php","_parent","name",'width=800,height=600,left=0,top=0,status=1,toolbar=0,fullscreen=1,location=0,menubar=0,titlebar=0');

but it is not working.
You can't have "_parent" and "name" .. choose one or the other.

Posted: Fri Mar 31, 2006 5:54 am
by madhu
hi again failed.

c i implemented like this.

window.open("filename.php","_parent",'width=800,height=600,left=0,top=0,status=0,toolbar=0,fullscreen=1,channelmode=1,location=0,menubar=0,titlebar=0');

but again addressbar is coming with that url

plz help,it is very urgent.............

waiting for ur replies..............

Posted: Fri Mar 31, 2006 6:26 am
by Chris Corbyn
Does your browser perhaps have an option that prevents JS from hiding the address bar?

In any case you don't need to explicitly set the options to false since you "add" window elements AFAIK. Also assign the result to a variable so you can manipulate it afterwards ;)

Code: Select all

var myWindow = window.open('some_url.php', 'blah', 'width=300,height=300,status=yes');

Posted: Fri Mar 31, 2006 6:39 am
by madhu
how to know that the browser have an option that prevents JS from hiding the address bar?


i already assigned that thing to a variable,eventhough it is not working.

doPopUpWindow = window.open("filename.php","_parent",'width=800,height=600,left=0,top=0,status=no,toolbar=no,fullscreen=yes,channelmode=yes,location=no,menubar=no,titlebar=no');

plz help..........
its very very urgent..........
waiting for ur valuable replies...............

Posted: Fri Mar 31, 2006 6:59 am
by John Cartwright
Moved to Client-Side.

Posted: Fri Mar 31, 2006 7:56 am
by onion2k
madhu wrote:how to know that the browser have an option that prevents JS from hiding the address bar?

i already assigned that thing to a variable,eventhough it is not working.

doPopUpWindow = window.open("filename.php","_parent",'width=800,height=600,left=0,top=0,status=no,toolbar=no,fullscreen=yes,channelmode=yes,location=no,menubar=no,titlebar=no');
The problem is due to mixing " and ' quotes in your JavaScript.

Code: Select all

<a href="#" onClick="window.open('t.php','popUpWindow','width=800,height=600,left=0,top=0,status=no,toolbar=no,location=no,menubar=no,titlebar=no');">CLick</a>
That should work.

You really need to get a JavaScript debugger. The problem is very, very obvious if you run the code though one (I use Firefox's Firebug extension).