Solved

Hiding AddressBar using Javascript

Posted on 2003-10-31
14
2,823 Views
Last Modified: 2012-08-14
I have and ASP page and i want to hide the address bar, tool bar when it loads using javascript in the same page, is it possible ?? ... the reason i want to do this is i have a very large amount of data to be transferred to the child window which i cannot do with window.open as it exceeds the max limit.
0
Comment
Question by:prashantuchil
  • 7
  • 4
  • 2
  • +1
14 Comments
 
LVL 3

Expert Comment

by:a_pravarakhya
ID: 9656810
try this:
window.open ( 'myfile.htm' , '' , location=0) ;

"For the nav bar you use the toolbar parameter = { yes | no | 1 | 0 } which
specifies whether to display the browser toolbar, making buttons such as
Back, Forward, and Stop available. The default is yes.

For the address bar you use the location parameter = { yes | no | 1 | 0 }
which specifies whether to display the input field for entering URLs
directly into the browser. The default is yes."
0
 
LVL 9

Expert Comment

by:bhagyesht
ID: 9656865
you cant hide the addressbar once the window is open but at the time of opening yes you can hide it.
0
 

Author Comment

by:prashantuchil
ID: 9656867
Hi,

the prob is i don't want to use window.open ... since the data to be passed to the new window(in which i do not want the address bar) is large, i'm submitting the form in the parent page and setting the action to the new window thus transferring data... this window was intially a modal dialog(before large data was being tranferred) ... so now i want to maintain the same look and feel....
0
 
LVL 9

Expert Comment

by:bhagyesht
ID: 9656890
the you can use a workaround. remove the taskbar at the start ie before getting your data.
page1->window.open->page2(without toolbar and large data) and close page one
to close page1 use the foll code

window.opener=top;
window.close();
0
 
LVL 9

Expert Comment

by:bhagyesht
ID: 9656901
the window.opener=top; will avoid the prompt(ie 5.5 and above only) of window being closed.
0
 

Author Comment

by:prashantuchil
ID: 9656933
:-)

    thanx for that but i need to return to the parent page after doing some processing in the child. also how do i open the child with window.open as the data saize is too large to pass as parameter.

0
 
LVL 9

Expert Comment

by:bhagyesht
ID: 9656982
then dont close the parent page change the size and move it out of the screen coordinates once your task is done restore it.

another alternative is use iframe this will allow you to set the data in iframe from the main window.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Expert Comment

by:blurSoul
ID: 9657022
You can open the child window with window.open like that.
Just change the values you need to change.

window.open("child.html","my_window","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=800,height=600,left=0,top=0")
0
 
LVL 9

Expert Comment

by:bhagyesht
ID: 9657042
blurSoul : prashant wrote "i cannot do with window.open "
0
 

Expert Comment

by:blurSoul
ID: 9657046
Expanding on what bhagyesht said, you could also open up the child page to full screen. This will hide your parent window. When you want to go back just close the child window.

To open a window to full screen you could use this:

<script type="text/javascript">
window.moveTo(0,0);
if (document.all) {window.resizeTo(screen.availWidth,screen.availHeight)}
else {window.outerHeight = screen.availHeight; window.outerWidth = screen.availWidth}
</script>
0
 

Expert Comment

by:blurSoul
ID: 9657056
but he posted " also how do i open the child with window.open as the data saize is too large to pass as parameter.
". 4 or 5 threads above this thread.
0
 
LVL 9

Accepted Solution

by:
bhagyesht earned 125 total points
ID: 9657062
prashant: another workaround. dont pass the data at the time of opening the window. but when the window is loaded in a hidden field set the data by refering it via the window name.

something like this
var a=window.open(...)
then check for the document.readystate to become complete till then loop it
then a.document.getElementById("<ur hidden field>").value=your data.
0
 

Expert Comment

by:blurSoul
ID: 9657098
prashantuchil, is that the ONLY child page you have? Or do you have many?

If its just one page(you could do it for many but it will be tedious), you could try to reload the child page using the onLoad event
onLoad="window.open(....")

however i don't think this is to proffesional
0
 
LVL 9

Expert Comment

by:bhagyesht
ID: 9668647
thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I know it’s not a new topic to discuss and it has lots of online contents already available over the net. But Then I thought it would be useful to this site’s visitors and can have online repository on vim most commonly used commands. This post h…
This is an explanation of a simple data model to help parse a JSON feed
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now