Help with popup window title

T

Targa

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,menubar=0,resizable=1,width=520,height=500,left
= 245,top = 262');");
}
// End -->
</script>


<a href="javascript:popUp('MyWindow.asp')">Click Here</a>
 
R

Randy Webb

Targa said:
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,menubar=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="javascript:popUp('MyWindow.asp')">Click Here</a>

Read the FAQ, section 4.24

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

DU

Randy Webb wrote:
[snipped]
eval("page" + id + " = window.open(URL, '" + id + "',
'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=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/author/dhtml/reference/methods/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,left=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 1024x768): 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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top