0

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>
4

1 に答える 1

0
<!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>

Ansgar Wiechers のおかげで修正しました

于 2013-10-16T21:01:54.360 に答える