JavaScript Forward (Elementary question)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Aleksander Solum

    #1

    JavaScript Forward (Elementary question)

    Dear friends

    I work for a very small business and therefore my job functions are
    quite varied, and once in a while I stumble upon something which I'm
    not really qualified to do.

    In this case I've run into a problem updating the company's (very
    simple) web site.

    For a variety of reasons, it's become necessary to create a web page
    that automatically forwards the user to another website on the same
    server.

    I was under the impression the following JavaScript code would perform
    this function, but it does not seem to work. I would be extremely
    happy if somebody could give me some hints as to what I'm doing wrong.

    The HTML/JavaScript I'm trying is this:

    <HTML>
    <HEAD>
    <script language="Javas cript">
    function forward()
    {
    location.href=" http://www.solumforlag .no/katalog/katalog.html";
    }
    </script>
    <TITLE>Please wait...</TITLE>
    <body onload=setTimeo ut('forward()', 5000)">
    </body>
    </HEAD>




    Regards
    Aleksander Solum
  • Mick White

    #2
    Re: JavaScript Forward (Elementary question)

    Aleksander Solum wrote:
    <snip>
    [color=blue]
    > function forward()
    > {
    > location.href=" http://www.solumforlag .no/katalog/katalog.html";
    > }
    > </script>
    > <TITLE>Please wait...</TITLE>
    > <body onload=setTimeo ut('forward()', 5000)">[/color]

    <body onload="setTime out('forward()' ,5000)">
    Missing "
    Mick[color=blue]
    > </body>
    > </HEAD>[/color]

    Comment

    • McKirahan

      #3
      Re: JavaScript Forward (Elementary question)

      "Aleksander Solum" <kasolum@ml1.ne t> wrote in message
      news:6f37b673.0 409140603.47f74 1ad@posting.goo gle.com...[color=blue]
      > Dear friends
      >
      > I work for a very small business and therefore my job functions are
      > quite varied, and once in a while I stumble upon something which I'm
      > not really qualified to do.
      >
      > In this case I've run into a problem updating the company's (very
      > simple) web site.
      >
      > For a variety of reasons, it's become necessary to create a web page
      > that automatically forwards the user to another website on the same
      > server.
      >
      > I was under the impression the following JavaScript code would perform
      > this function, but it does not seem to work. I would be extremely
      > happy if somebody could give me some hints as to what I'm doing wrong.
      >
      > The HTML/JavaScript I'm trying is this:
      >
      > <HTML>
      > <HEAD>
      > <script language="Javas cript">
      > function forward()
      > {
      > location.href=" http://www.solumforlag .no/katalog/katalog.html";
      > }
      > </script>
      > <TITLE>Please wait...</TITLE>
      > <body onload=setTimeo ut('forward()', 5000)">
      > </body>
      > </HEAD>
      >
      >
      >
      >
      > Regards
      > Aleksander Solum[/color]

      Here's an alternative that may suit your needs:

      <html>
      <head>
      <meta http-equiv="refresh" content="0;
      URL=http://www.solumforlag .no/katalog/katalog.html">
      <title>default. htm</title>
      </head>
      <body>
      <a href="http://www.solumforlag .no/katalog/katalog.html"> Click here! </a>
      </body>
      </html>

      I put something like the above (but called "default.ht m") in subfolders
      (e.g. "images") on my Web site to redirect visitors to my Home page in case
      my Web host allows directory browsing.



      Comment

      Working...