• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2833
  • Last Modified:

Hiding AddressBar using Javascript

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
prashantuchil
Asked:
prashantuchil
  • 7
  • 4
  • 2
  • +1
1 Solution
 
a_pravarakhyaCommented:
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
 
bhagyeshtCommented:
you cant hide the addressbar once the window is open but at the time of opening yes you can hide it.
0
 
prashantuchilAuthor Commented:
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
bhagyeshtCommented:
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
 
bhagyeshtCommented:
the window.opener=top; will avoid the prompt(ie 5.5 and above only) of window being closed.
0
 
prashantuchilAuthor Commented:
:-)

    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
 
bhagyeshtCommented:
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
 
blurSoulCommented:
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
 
bhagyeshtCommented:
blurSoul : prashant wrote "i cannot do with window.open "
0
 
blurSoulCommented:
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
 
blurSoulCommented:
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
 
bhagyeshtCommented:
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
 
blurSoulCommented:
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
 
bhagyeshtCommented:
thanks
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

  • 7
  • 4
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now