473,387 Members | 1,512 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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


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
8 3294
Scripsit pa*********@gmail.com:
I am using the following javascript to make a popup menu allow the
user to navigate to different pages on a website.
Why? Do you want to take extra effort to prevent millions of people from
navigating your site?
Yet it is opening windows as if I have <base target="some-name">
defined in the body.
Well, have you? You didn't specify the URL, so we cannot check that for you.
<script language=javascript>
<!-- Begin
Thinking about Netscape 2, or what?
open(document.popupForm.popup.options
[document.popupForm.popup.selectedIndex].value,"content");
Maybe you should figure out what the open() method does. But not here. This
group is about HTML authoring for the WWW.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Jun 21 '07 #2
RvT
Yet it is opening windows as if I have <base target="some-name">
defined in the body.
BASE should be defined in the HEAD, not the BODY.

Jun 22 '07 #3
RvT
BASE should be defined in the HEAD, not the BODY.

Jun 22 '07 #4
pa*********@gmail.com wrote:
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>
Yes, that's what the open method (meaning window.open, as window is the
default object in browser scripts when a method is invoked without an
explicit object) was designed to do: open a window. And so it does,
unless the OS or user agent doesn't support multiple windows or the
browser has been configured to open the given URL in a new tab or in the
existing window.
Jun 22 '07 #5
Sorry, I just realized I misunderstood the nature of your question.
Never mind.
Jun 22 '07 #6
Harlan Messinger wrote:
Sorry, I just realized I misunderstood the nature of your question.
Never mind.
Actually, you *were* talking about the target attribute. I just hadn't
realized it could be used in a BASE tag. So what I originally said is
correct: unlike the default behavior for an A tag, windows.open in most
cases, by default, opens a new window.
Jun 22 '07 #7
On Jun 21, 1:26 pm, "Jukka K. Korpela" <jkorp...@cs.tut.fiwrote:
Scripsit paintedj...@gmail.com:
I am using the following javascript to make a popup menu allow the
user to navigate to different pages on a website.

Why? Do you want to take extra effort to prevent millions of people from
navigating your site?
Well, first, the website is limited to my subnet via .htaccess so I
don't want millions of people navigating the website. Secondly, are
you suggesting that it is a poor navigation technique? It works
perfectly now that I solved the problem with the javascript open.
However, I'd be interested in any problems that such a navigation
feature would introduce.

Yet it is opening windows as if I have <base target="some-name">
defined in the body.

Well, have you? You didn't specify the URL, so we cannot check that for you.
<script language=javascript>
<!-- Begin

Thinking about Netscape 2, or what?
I presume that you mean the HTML comment is now unnecessary?

open(document.popupForm.popup.options
[document.popupForm.popup.selectedIndex].value,"content");

Maybe you should figure out what the open() method does. But not here. This
group is about HTML authoring for the WWW.
Since it was my first post on this NG, I mistakenly assumed that it
would cover any topic under HTML. Upon learning the name of the
newsgroup for Javascript, I posted the same question there and learned
what the problem was. By the way, I don't claim to be a Javascript
programmer. I simply borrowed free code on the net in an attempt to
accomplish a desired result. Surely, you don't think that only expert
Javascript programmers are allowed to post here or there
(comp.lang.javascript).

Jun 22 '07 #8
Scripsit pa*********@gmail.com:
It works
perfectly now that I solved the problem with the javascript open.
However, I'd be interested in any problems that such a navigation
feature would introduce.
Are you serious? Turn JavaScript off and check again.
>Well, have you? You didn't specify the URL, so we cannot check that
for you.
Why did you quote that when you had nothing to reply - especially no URL?
Since it was my first post on this NG, I mistakenly assumed that it
would cover any topic under HTML.
Which of the letters in the part "www" did you fail to understand?
I simply borrowed free code on the net in an attempt to
accomplish a desired result.
That's compatible with other foolishness that you have exhibited.
Surely, you don't think that only expert
Javascript programmers are allowed to post here or there
(comp.lang.javascript).
So you still don't know what this group is for, or don't care? Never mind,
you will most probably be ignored here now, except perhaps by people who
share your cluelessness.

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Jun 22 '07 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Display Name | last post by:
When this form's being submitted, two windows are opening instead of only one here is the function I'm using: function subForm(){ //insert form validation here //if form is valid, open a...
7
by: Joker7 | last post by:
Hi, This is still giving me a big problem !! Maybe if I post the original code here it may be of more help as the above will/is not working. $link = "<a
2
by: Matt Hamilton | last post by:
I have an application page with a datagrid with a checkbox on each row. The user should check the rows they want to modify and then click a button. When the button is clicked, I have a Click...
3
by: Chris Paul | last post by:
I'm having trouble with PHP & PostgreSQL/OpenLDAP/Apache on Windows. I've set this up countless times on BSD (piece of cake) but I'm trying to do this on Windows now so that my developer can work...
44
by: Viken Karaguesian | last post by:
Hello all, On occasion I want to open hyperlinks (images, etc.) in a new window. In the past, I've used target="_blank" to open the link in a new window. However, using the "target" attribute...
0
by: Shadow Lynx | last post by:
When using ASP.NET 2.0's built-in TreeView on a page with <BASE target = "AnythingBut_Self"></BASE> in the HEAD, the expand/collapse buttons fail to function. The reason for this is that the...
1
by: paintedjazz | last post by:
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...
2
by: cmonthenet | last post by:
Hello, I searched for an answer to my question and found similar posts, but none that quite addressed the issue I am trying to resolve. Essentially, it seems like I need something like a virtual...
5
by: dm3281 | last post by:
I'm really starting to hate writing services -- or trying to, anyway. Why do I need to rename my project to the service name? Why do I need to set the "ServiceName" property to my service name?...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.