Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Hiding AddressBar using Javascript

Posted on 2003-10-31
14
2,826 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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
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
 

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

829 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