
October 2nd, 2003, 10:17 AM
|
|
Junior Member
|
|
Join Date: Aug 2003
Location: Houston, TX
Posts: 13
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
VBScript Screen.Width, etc Question
Hello All-
1) How can I get my VBScript to access/call Javascript functions and variables?
2) Im trying to store the Screen.Width and Screen.Height values into variables that I can use throughout my VBScript code.
Why does this work:
Code:
<html><head><title>DSS: Home</title>
<link href="main.css" rel="stylesheet" type="text/css">
<SCRIPT language="VBScript">
<!--
Dim strInfo
strInfo = "<CENTER><TABLE WIDTH=100%>" _
& "<TR><TD>screen.width</TD>" _
& "<TD><B>" & screen.width & "</TD></TR>" _
& "<TR><TD>screen.height</TD>" _
& "<TD><B>" & screen.height & "</TD></TR>" _
& "</TABLE></CENTER><P>"
document.write strInfo
-->
</script></head></html>
But when i move the same vbscript code above to my VBScript Functions, it doesnt work. I get the "Microsoft VBScript runtime error '800a01a8'
Object required: 'screen'" error.
Code:
<%
Function Temp2()
<!--
Dim strInfo
strInfo = "<CENTER><TABLE WIDTH=100>" _
& "<TR><TD>screen.width</TD>" _
& "<TD><B>" & screen.width & "</TD></TR>" _
& "<TR><TD>screen.height</TD>" _
& "<TD><B>" & screen.height & "</TD></TR>" _
& "</TABLE></CENTER><P>"
document.write strInfo
-->
End Function
%>
Thanks-
matt
|