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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • paintedjazz@gmail.com

    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=javasc ript>
    <!-- Begin
    function navigate()
    {
    open(document.p opupForm.popup. options
    [document.popupF orm.popup.selec tedIndex].value,"content ");
    }
    // End -->
    </script>

    This is the form:

    <form name="popupForm ">
    <select name="popup" onchange="navig ate();">
    <option selected>Naviga te to:
    <option value="../../Library">Librar y
    <option value="../Science">Scienc e
    <option value="Logos">L ogos
    </select>
    </form>

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

  • Jukka K. Korpela

    #2
    Re: Why are windows opening as if base target is being used?

    Scripsit paintedjazz@gma il.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=javasc ript>
    <!-- Begin
    Thinking about Netscape 2, or what?
    open(document.p opupForm.popup. options
    [document.popupF orm.popup.selec tedIndex].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")


    Comment

    • RvT

      #3
      Re: Why are windows opening as if base target is being used?

      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.

      Comment

      • RvT

        #4
        Re: Why are windows opening as if base target is being used?

        BASE should be defined in the HEAD, not the BODY.

        Comment

        • Harlan Messinger

          #5
          Re: Why are windows opening as if base target is being used?

          paintedjazz@gma il.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=javasc ript>
          <!-- Begin
          function navigate()
          {
          open(document.p opupForm.popup. options
          [document.popupF orm.popup.selec tedIndex].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.

          Comment

          • Harlan Messinger

            #6
            NEVER MIND: Re: Why are windows opening as if base target is beingused?

            Sorry, I just realized I misunderstood the nature of your question.
            Never mind.

            Comment

            • Harlan Messinger

              #7
              No, actually I was right the first time

              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.

              Comment

              • paintedjazz@gmail.com

                #8
                Re: Why are windows opening as if base target is being used?

                On Jun 21, 1:26 pm, "Jukka K. Korpela" <jkorp...@cs.tu t.fiwrote:
                Scripsit paintedj...@gma il.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=javasc ript>
                <!-- Begin
                >
                Thinking about Netscape 2, or what?
                I presume that you mean the HTML comment is now unnecessary?

                open(document.p opupForm.popup. options
                [document.popupF orm.popup.selec tedIndex].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.java script).

                Comment

                • Jukka K. Korpela

                  #9
                  Re: Why are windows opening as if base target is being used?

                  Scripsit paintedjazz@gma il.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.java script).
                  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")


                  Comment

                  Working...