Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Redirecting using the equivalent of window.location in javascript

Status
Not open for further replies.

atuvy

Programmer
Oct 31, 2000
1
US
I need to redirect to another web page. In javascript I used windo.redirecr() what is the equivalent in vbscript?
 
Here is an example of both js and vbs ways (exactly the same)
Code:
<html>
<script language = &quot;vbscript&quot;>
sub vbsSwitch(page)
 top.location.href = page
end sub
</script>

<script language = &quot;javascript&quot;>
function jsSwitch(page){
 top.location.href = page
}
</script>
<body>
 <input type=button value=&quot;VBS Switch&quot; onClick=&quot;vbsSwitch('test2.html')&quot;>
 <input type=button value=&quot;JS Switch&quot; onClick=&quot;jsSwitch('test3.html')&quot;>
</body>
</html>

Use &quot;open&quot; instead of &quot;top&quot; to open a new page.

Later, Rob
robschultz@yahoo.com
-Focus on the solution to the problem, not the obstacles in the way.-
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top