PDA

View Full Version : How do I name each window?


webcom8
04-21-2003, 11:26 PM
In the following script, I have been told, “window name should be different for each”. How do I name each window? Could someone point me further along with an example of the correct code. My attempt brought up errors.

Thanks,
Thomas





<script>

function openpopup(){
var popurl="comm1.htm"
winpops=window.open(popurl,"","width=480,height=450,status,")
}

</script>

<script>

function openpopup(){
var popurl="comm2.htm"
winpops=window.open(popurl,"","width=480,height=450,status,")
}

</script>

<script>

function openpopup(){
var popurl="comm3.htm"
winpops=window.open(popurl,"","width=480,height=450,status,")
}

</script>

<script>

function openpopup(){
var popurl="comm4.htm"
winpops=window.open(popurl,"","width=480,height=450,status,")
}

</script>

<script>

function openpopup(){
var popurl="comm5.htm"
winpops=window.open(popurl,"","width=480,height=450,status,")
}

</script>
:(

smeagol
04-21-2003, 11:54 PM
You specify the Window Name inside the window.open section.

Like this:

winpops=window.open(popurl,"window_name_here","width=480,height=450,status,")

This will name the window "window_name_here".

Borgtex
04-22-2003, 07:57 PM
As all the functions are similar, you can simplify them in one:

<script>
function openpopup(name,popurl)
{
winpops=window.open(popurl,name,"width=480,height=450,status,")
}
</script>

and then...

openpoup('name1','comm1.htm')
openpoup('name2','comm2.htm')

justagirl
05-03-2003, 06:32 PM
Here's what I have. I don't know what to do anymore.
BTW for the o in "openpop" it's inserting a smily; I have to idea why.

<script>
//Popup Window Script
function openpopup()
{
var popurl="abalone.htm"
winpops=window.open(popurl,"abalone","width=400,height=338,resizable,")
}
</script>
<a href="javascript:openpopup()">Abalone Inlay</a>

<script>
//Popup Window Script
function openpopup()
{
var popurl="pearl.htm"
winpops=window.open(popurl,"pearl","width=400,height=338,resizable,")
}
</script>
<a href="javascript:openpopup()">Mother of Pearl Inlay</a>

<script>
//Popup Window Script
function openpopup()
{
var popurl="brass.htm"
winpops=window.open(popurl,"brass","width=400,height=338,resizable,")
}
</script>
<a href="javascript:openpopup()">Polished Brass</a>

<script>
//Popup Window Script
function openpopup()
{
var popurl="dots.htm"
winpops=window.open(popurl,"dots","width=400,height=338,resizable,")
}
</script>
<a href="javascript:openpopup()">Mother of Pearl Dot (Traditional Shape)</a>

Any help is appreciated.

Thanks, JustAGirl

Antoniohawk
05-03-2003, 10:48 PM
Try this:

<script>
function openpopup(name,popurl)
{
winpops=window.open(popurl,name,"width=480,height=450,status);
}
</script>

<a href="javascript:openpopup('abalone.htm','abalone')">Abalone Inlay</a>

<a href="javascript:openpopup('pearl.html','pearl')">Mother of Pearl Inlay</a>

<a href="javascript:openpopup('brass.html','brass')">Polished Brass</a>

<a href="javascript:openpopup('dots.htm','dots')">Mother of Pearl Dot (Traditional Shape)</a>


PS:
All of the smilies should be replaced with :+o, but take out the '+'.