I am trying to refresh my iframe every 30 sec and have it swtich to an error page if the page is unavaiable. I get a "Cannot use parentheses when calling a Sub" error and the vbscript never works. I have looked at several examples of others trying to do similar things, and i cannot tell what i am doing wrong.
<!DOCTYPE html>
<html>
<head>
<title>Census Status</title>
</head>
<body>
<iframe class="main" id="main" src="G:\CensusAlert\Default.html" width="96%" height="95%"></iframe>
<script type="text/vbscript">
Function refreshGadget
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set iFrame = document.getElementById("main")
If objFSO.FileExists("G:\CensusAlert\Default.html") then
iFrame.src = "G:\CensusAlert\Default.html"
Else
iFrame.src = "C:\Program Files\SAMCAlert\Error.html"
End If
End Function
window.setInterval(refreshGadget, 30000, VBScript)
</script>
</body>
</html>