How to hide address bar with Javascript or PHP

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
madhu
Forum Commoner
Posts: 82
Joined: Fri Mar 03, 2006 9:34 am

How to hide address bar with Javascript or PHP

Post 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.
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

http://msdn.microsoft.com/workshop/auth ... open_0.asp

Mind you, right click and View Page Info will reveal the URL..
madhu
Forum Commoner
Posts: 82
Joined: Fri Mar 03, 2006 9:34 am

Post 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...........
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post 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.
madhu
Forum Commoner
Posts: 82
Joined: Fri Mar 03, 2006 9:34 am

Post 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..............
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post 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');
madhu
Forum Commoner
Posts: 82
Joined: Fri Mar 03, 2006 9:34 am

Post 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...............
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Moved to Client-Side.
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post 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).
Post Reply