|
-
May 1st, 2002, 08:06 AM
#1
"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?
-
May 1st, 2002, 08:42 AM
#2
Fanatic Member
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>
-
May 1st, 2002, 09:20 AM
#3
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|