I have to support an old web server developed in classic ASP and VBScript. I am running on Windows 7 with IIS 7.5.
I followed all the instructions on configuring the IIS from this article. The web page loads, but it looks like the JS doesn't see functions in VBScript.
I have this code:
<%@ Language=VBScript %>
<!-- #include file="HebrewMeta_UTF8.jv"-->
<link rel="stylesheet" type="text/css" href="../Class.css">
<html>
<head>
<%
Nm=Request("Nm")
%>
<title>my page</title>
</head>
<script LANGUAGE="javascript">
var Nm = "<%=Nm%>";
function onCheckPro() {
nm = window.navigator.appName;
if ((nm.indexOf("Explorer") == "-1") && (nm.indexOf("Netscape") == "-1")){
alert(" Compatibility שינוי הגדרות ");
window.open("http://www.comax.co.il/InstallTools/compatibility-view.reg");
//alert("ניתן להפעיל באקספלורר בלבד");
//return;
}
document.all.fr.src = "CheckLogInPro.asp?Kod=" + escape(Kod.value) + "&Pass=" + escape(Pass.value) + "&Date=" + vbDate();
}
</script>
<script LANGUAGE="vbscript">
function vbDate()
vbDate=Cstr(Day(Date()))+"/"+Cstr(Month(Date()))+"/"+Cstr(Year(Date()))+" "+Cstr(hour(Now()))+":"+Cstr(Minute(Now()))+":"+Cstr(Second(Now()))
end function
</script>
I keep on getting "'vbDate' is undefined".
The script language of the site ASP is set to VBScript.
<script language="vbscript" runat="server"></script>
or<% %>
. Any code written inside the<% %>
tags will be VBScript executed on the "server-side" by default (VBScript is the default scripting engine for Classic ASP). – user692942onCheckPro()
looks like it's checking for Netscape, which makes it at least ten years old – John