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

Discussion in 'Javascript' started by paintedjazz@gmail.com, Jun 20, 2007.

  1. Guest

    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, 2007
    #1
    1. Advertising

  2. Lee Guest

    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>


    --
    Lee, Jun 21, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. JezB

    Why isn't my style being used ?

    JezB, May 25, 2004, in forum: ASP .Net
    Replies:
    6
    Views:
    377
  2. Mr. SweatyFinger

    why why why why why

    Mr. SweatyFinger, Nov 28, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    837
    Mark Rae
    Dec 21, 2006
  3. Mr. SweatyFinger
    Replies:
    2
    Views:
    1,656
    Smokey Grindel
    Dec 2, 2006
  4. Alf P. Steinbach
    Replies:
    6
    Views:
    525
    John Carson
    Sep 3, 2005
  5. mohit
    Replies:
    0
    Views:
    519
    mohit
    Jan 23, 2008
Loading...

Share This Page