Sputti: ASP Code in JS Funktion

Beitrag lesen

Hallo,
habe folgendes Problem, habe eine JS Funktion in welcher auch ASP Code steht. Ich ruf die JS Funktion mit einem Timeout auf. Doch der ASP Code wird sofort ausgeführt und nur der JS Code(die alert Aufrufe)) wartet auf das Ende des Timeouts.
Kann mir jemand sagen, woran das liegt?

function wait(){
setTimeout("alert('TEST Start')",1000);
<%
set objFs = CreateObject("Scripting.FileSystemObject")

strDay = Day(DATE)
strMonth = Month(DATE)
strYear = Year(DATE)
strHour = Hour(TIME)
zeit = TIME
strDateTest = strYear & "" & strMonth & "" & strDay & "" & strHour

strOkFile = "BAQIMW_" & strDateTest & ".ok"
strErrFile = "BAQIMW_" & strDateTest & ".err"
strTestFile = "BAQIMW_" & strDateTest & ".s0x"
strExistOkFile = Server.MapPath(strOkFile)
set FileOkObject = Server.CreateObject("Scripting.FileSystemObject")
strExistTestFile = Server.MapPath(strTestFile)
set FileTestObject = Server.CreateObject("Scripting.FileSystemObject")
strExistErrFile = Server.MapPath(strErrFile)
set FileErrObject = Server.CreateObject("Scripting.FileSystemObject")

if FileOkObject.FileExists(strExistOkFile) then

elseif (FileTestObject.FileExists(strExistTestFile)) OR (FileErrObject.FileExists(strExistErrFile)) then

newTime = DATEADD("s",1,TIME)
newDay = Day(DATE)
newMonth = Month(DATE)
newYear = Year(DATE)
newHour = Hour(newTime)
newMinute = Minute(newTime)
newSecond = Second(newTime)
newDate = newYear & "" & newMonth & "" & newDay & "" & newHour & "" & newMinute & "" & newSecond
newFile = "BAQIMW_" & newDate & ".sms"

strNeueDatei = Server.MapPath(newFile)
strNewSkript = Server.MapPath("uc5.tmp")
Set newTextStream = objFs.CreateTextFile(strNeueDatei, True)

newTextStream.Write strWriteNameX
newTextStream.Write strWriteVornameX
newTextStream.Write (";Tel:")
newTextStream.Write strWriteTelnrX
newTextStream.Close
Set newTextStream = Nothing
'UC Dateiinhalt
strNewFileName = "FILENAME = " & chr(34) & ""& newFile &"" & chr(34) & ""
strNewBuffer = "SHARE = " & chr(34) & "\AR0BQ05\WEB$\LBS2-BS" & chr(34) & ""

Set objSkript = objFs.CreateTextFile(strNewSkript, True)

objSkript.WriteLine strNewFileName
objSkript.WriteLine strNewBuffer
Set objSkript = Nothing

end if
%>
setTimeout("alert('TEST Ende')",1000);
}
window.setTimeout("wait()",10000);