Why are windows opening as if base target is being used?

P

paintedjazz

I am using the following javascript to make a popup menu allow the
user to navigate to different pages on a website.
Yet it is opening windows as if I have <base target="some-name">
defined in the body.

<script language=javascript>
<!-- Begin
function navigate()
{
open(document.popupForm.popup.options
[document.popupForm.popup.selectedIndex].value,"content");
}
// End -->
</script>

This is the form:

<form name="popupForm">
<select name="popup" onchange="navigate();">
<option selected>Navigate to:
<option value="../../Library">Library
<option value="../Science">Science
<option value="Logos">Logos
</select>
</form>

Can anyone see anything that would be causing this? Thanks for any
help.
 
L

Lee

(e-mail address removed) said:
I am using the following javascript to make a popup menu allow the
user to navigate to different pages on a website.
Yet it is opening windows as if I have <base target="some-name">
defined in the body.

<script language=javascript>
<!-- Begin
function navigate()
{
open(document.popupForm.popup.options
[document.popupForm.popup.selectedIndex].value,"content");
}
// End -->
</script>

This is the form:

<form name="popupForm">
<select name="popup" onchange="navigate();">
<option selected>Navigate to:
<option value="../../Library">Library
<option value="../Science">Science
<option value="Logos">Logos
</select>
</form>

Can anyone see anything that would be causing this? Thanks for any
help.

It's doing (of course) exactly what you're telling to do.
The open() method opens a new window.
If what you really want to do is to load a new page into
the current window, you change the "location" attribute:

<form name="popupForm">
<select name="popup"
onchange="location=options[selectedIndex].value">
<option selected>Navigate to:
<option value="../../Library">Library
<option value="../Science">Science
<option value="Logos">Logos
</select>
</form>


--
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top