We help IT Professionals succeed at work.

Remove www address prefix from Javascript window, fix scrolling

scrathcyboy
scrathcyboy asked
on
Medium Priority
362 Views
Last Modified: 2008-03-17
When opening a Javascript window of a page, Mozilla and Firefox prefix the page header at top of window with -
http://www.whateversitenamerelatetopage.com
Even though I set a valid title for page.  IE do the same too, but when it finish loading page, IE correctly replace www address with the correct page title supplied for the page.

I do not want the web address to show at all, it is nuisance - just the normal page title, as you would see opening normal link to html page.  Please tell me how to fix.  Typical opener is -

window.open(newpage.html,"","status,height=550,width=470,scrolling=yes,resizable=yes,toolbar=0");

Also, even though I put scrolling=yes, neither IE or Moz/FF show v. scroll bars.  Can you fix this too?  Thx.
Comment
Watch Question

Commented:
Hi,

Last question first.  Is your 'newpage.html' long enough to require scrolling in your new window?  Even with 'scrolling=yes', the browser doesn't need to add the scroll bars if there's no content to scroll.

Peace and joy.  mvan

Commented:
Also, you need to add location=no to your list of window attributes in your open call:

window.open("newpage.html","","location=no,status=yes,height=550,width=470,scrolling=yes,resizable=yes,toolbar=0");

Peace and joy.  mvan

Author

Commented:
yes, tested with data longer than window size, but no scroll bar.  Very wierd, have not seen before.  I will try location=no, let you know.  thanks.

Author

Commented:
I already had location=no in the other popup doing the same thing.  I added it to the first, and it makes no difference.  Perhaps I need to quote it?  Here are the two parameter lists for both popups -

     var features = "height=350,width=350,scrollbars=yes,status=no,menubar=no,location=no";

window.open(pg,"","status,height=550,width=470,scrolling=yes,resizable=yes,toolbar=0 location=no");

The both open popups in slightly different ways, both show the WWW location in Moz/FF.

Commented:
nah.  Don't quote it.  The entire set of settings need to be in one string, and the values are not separately quoted.  Note that in the second one, you say "status, ... but not "status=no, ...  status, without an = sign means: status=yes,  but that's the status bar at the bottom of the browser.  

Here's a good source:
http://www.w3schools.com/htmldom/met_win_open.asp

It says scrollbars=no is supported.  No mention of scrolling= .  It's possible that it hits the scrolling=yes, realizes it is not supported, and does not finish with location=no, in your second example.  Check each parameter with the website listed above, to see if you've used each word exactly as they show.

Peace and joy.  mvan

Author

Commented:
changed order, put location=no at front, checked in console for JS errors on open popup -- no errors, still no scroll bars, and Moz/FF still showing location, but IE not  Am stumped.

Author

Commented:
I got the scrollbars to appear, a small JS error in another page was stopping this from working in Moz/FF, very unusual.  But with no errors at all now, the URL is still present, cant get rid of it in Moz/FF.
Commented:
Hi scrathcyboy,

Now I see you said "in the page header at the top of the window" and "Even though I set a valid title for page."  So, you are talking about the 'titlebar,' not the location or address bar (where you can type in a url).

Look here to see some items associated with window.open which FireFox can more closely control.  It will limit what window.open can and cannot do.  This is configurable by the user for added security, to prevent spoofing, etc.:
http://kb.mozillazine.org/Firefox_:_FAQs_:_About:config_Entries

Then, here's a site which tells how to change the constant portion of the titlebar.  You know, in IE it always says something like:
Website Title Goes Here - Microsoft Internet Explorer
with the ' - Microsoft Internet Explorer' being a fixed entry appearing in the titlebar.  (That can be changed by editing an entry in the Windows registry.)  In FireFox, this is configurable, and this page tells how.  I mention this because maybe that configuration can also be directed to place the current page address in the titlebar as well, though this specific article does not say so:
http://hacks.oreilly.com/pub/h/3356

Also, it may be very helpful to thoroughly check this out:
http://www.cosmicat.com/extensions/titletweak/

Peace and joy.  mvan

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
Thanks for those links mvan, you have spent long enough on this, I will close now, thx for the help again.

Commented:
You are welcome.  Peace and joy.  mvan
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.