Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Hiding AddressBar using Javascript

Posted on 2003-10-31
14
Medium Priority
?
2,832 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
[X]
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
  • 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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 500 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Make the most of your online learning experience.
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…
Starting up a Project

618 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