Open URL

Discussion in 'JavaScript' started by neolegionar, Jun 16, 2007.

  1. #1
    Does anyone know how can i open an URL in the current window using a Java function?
     
    neolegionar, Jun 16, 2007 IP
  2. dankenpo

    dankenpo Guest

    Messages:
    30
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Good question. We solve this with a redirection function:

    
    <html>
    <head>
    <script language="JavaScript">
    <!--
    function redirectLink() {
       window.location="newlink.php"
    }
    // -->
    </script>
    </head>
    
    <body>
    <a href="javascript:redirectLink()">Redirect</a>
    </body></html>
    
    Code (markup):
    That should do it!
     
    dankenpo, Jun 16, 2007 IP