Results 1 to 3 of 3

Thread: "Hyperlink" in VBScript

  1. #1
    Tarrquin
    Guest

    Question "Hyperlink" in VBScript

    Hi,

    A simple question with, I hope, a simple answer!

    I have a web html page which uses VBScript. Within the script I do some calculations and then I want to jump to a certain point within the html, as if a hyperlink had been clicked on that page.

    How do I do that, please?

  2. #2
    Fanatic Member punkpie_uk's Avatar
    Join Date
    Sep 2001
    Location
    UK
    Posts
    645
    Hi,

    You can use a Named Anchor on the page and use document.location.href.

    FYI, the gibberish in the middle is just to test it

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    
    <html>
    <head>
    <title>Untitled</title>
    <script language="vbscript">
    <!--
    Sub goToPlace()
    document.location.href="#item1"
    End Sub
    //-->
    </script>
    
    </head>
    <body>
    <input type="button" value="go to item1" onclick="goToPlace()">
    bfdbdhr<Br>bfdbdhr<Br>bfdbdhr<Br>
    bfdbdhr<Br>bfdbdhr<Br>bfdbdhr<Br>
    bfdbdhr<Br>bfdbdhr<Br>bfdbdhr<Br>
    bfdbdhr<Br>bfdbdhr<Br>bfdbdhr<Br>
    bfdbdhr<Br>bfdbdhr<Br>bfdbdhr<Br>
    bfdbdhr<Br>bfdbdhr<Br>bfdbdhr<Br>
    bfdbdhr<Br>bfdbdhr<Br>bfdbdhr<Br>
    bfdbdhr<Br>bfdbdhr<Br>bfdbdhr<Br>
    bfdbdhr<Br>bfdbdhr<Br>bfdbdhr<Br>
    bfdbdhr<Br>bfdbdhr<Br>bfdbdhr<Br>
    <a name="item1">
    this is after item 1
    </body>
    </html>
    SPREAD THE WORD!!! Are You Lee McCormick? Because I Am



    Lee M McCormick
    [email protected]

    Lee McCormick.com - Live
    Dynamically Webbed.com - In development but live

  3. #3
    Tarrquin
    Guest

    Smile

    Hi punkpie_uk,

    Just tried it out and it works fine! Thanks very much for your help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width