Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Help with popup window title

Reply
Thread Tools

Help with popup window title

 
 
Targa
Guest
Posts: n/a
 
      10-22-2004
Im using the code below to pop up a window: It works fine except for that in
the titlebar, my domain name is listed before the page title like below:

http://mydomain.com - MyPopupwindowname - Microsoft Internet Explorer

Is there any way to remove this or otherwise control what is displayed in
the titlebar? I just want it to display the page title - thats it. I dont
really care about the MSIE but I mainly dont want the domain to display.

Thanks in advance!

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "',
'toolbar=0,scrollbars=1,location=0,statusbar=0,men ubar=0,resizable=1,width=520,height=500,left
= 245,top = 262');");
}
// End -->
</script>


<a href="javascriptopUp('MyWindow.asp')">Click Here</a>



 
Reply With Quote
 
 
 
 
Randy Webb
Guest
Posts: n/a
 
      10-22-2004
Targa wrote:

> Im using the code below to pop up a window: It works fine except for that in
> the titlebar, my domain name is listed before the page title like below:
>
> http://mydomain.com - MyPopupwindowname - Microsoft Internet Explorer
>
> Is there any way to remove this or otherwise control what is displayed in
> the titlebar? I just want it to display the page title - thats it. I dont
> really care about the MSIE but I mainly dont want the domain to display.


I don't get that behavior in IE6 SP2 with your code.

> Thanks in advance!
>
> <SCRIPT LANGUAGE="JavaScript">


<script type="text/javascript">

The type attribute is mandatory in HTML4, and the language attribute is
deprecated.

> <!-- Begin


Script hiding is no longer needed.

> function popUp(URL) {
> day = new Date();
> id = day.getTime();


So far, iffy. But its getting worse faster.

> eval("page" + id + " = window.open(URL, '" + id + "',
> 'toolbar=0,scrollbars=1,location=0,statusbar=0,men ubar=0,resizable=1,width=520,height=500,left
> = 245,top = 262');");


Two problems with that line of code:

1) The un-needed eval.

http://jibbering.com/faq/#FAQ4_40

The only purpose I can think of to do what you are trying to do is to
ensure you have a unique window by giving it a unique window name. The
variable "page" + id can be generated using window["page" + id]

2) The attributes section of the window.open call (the third parameter)
can not contain spaces.

And a note:

Any attribute that is set to its default setting can be omitted in the
parameters. You don't have to specify resizable=1.

What you end up with is this:

window["page" + id] = window.open(URL, id, 'parameters here')


> }
> // End -->


Script hiding is no longer needed.

> </script>
>
>
> <a href="javascriptopUp('MyWindow.asp')">Click Here</a>


Read the FAQ, section 4.24

http://jibbering.com/faq/#FAQ4_24


--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq
 
Reply With Quote
 
 
 
 
DU
Guest
Posts: n/a
 
      10-22-2004
Randy Webb wrote:
[snipped]

>
>> eval("page" + id + " = window.open(URL, '" + id + "',
>> 'toolbar=0,scrollbars=1,location=0,statusbar=0,men ubar=0,resizable=1,width=520,height=500,left
>> = 245,top = 262');");

>


[snipped]

> And a note:
>
> Any attribute that is set to its default setting can be omitted in the
> parameters. You don't have to specify resizable=1.
>


On the contrary. He has to if/since there is a non-empty windowFeatures
string.
"When the sFeatures parameter is specified, the features that are not
defined in the parameter are disabled."
http://msdn.microsoft.com/workshop/a...ods/open_0.asp

> What you end up with is this:
>
> window["page" + id] = window.open(URL, id, 'parameters here')
>


then:

window["page" + id] = window.open(URL, id,
"scrollbars=1,resizable=1,width=520,height=500,lef t=245,top=262");

Another note: top value will not be honored, will have to be adjusted
because top + height are greater than the availHeight of most users'
screen res. (800x600 and 1024x76: there is now a correction mechanism
in Mozilla and MSIE 6 SP2 implemented to make sure that secondary
windows are NOT offscreen, are always within the available work area for
applications.
The fact that now MSIE 6 SP2 allows users to force presence of statusbar
also makes coding top and height values more restrictive, constraining.

DU
--
The site said to use Internet Explorer 5 or better... so I switched to
Mozilla 1.7.3
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
different window title and browser tab title soonic HTML 11 07-27-2011 07:59 PM
How 2 place page title into window title using sitemap in master page? bednar.tomas@gmail.com ASP .Net 0 11-30-2006 03:17 PM
Timing Issue - Setting Title of IFrame Modal Dialog Window Using the Contained Window Title Russell Javascript 2 09-13-2004 12:57 PM
New Popup Window from an existing Popup Window Raffi Javascript 4 08-12-2004 01:21 PM
Main > Popup > Popup > Close popup AND new URL in main? Jens Peter Hansen Javascript 7 06-19-2004 08:56 PM



Advertisments