By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,422 Members | 1,615 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,422 IT Pros & Developers. It's quick & easy.

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

P: n/a
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.

Jun 20 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Lee
pa*********@gmail.com 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>
--

Jun 20 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.