vbtest.html 1.04 KB
Newer Older
1 2 3
<html>
<head>
<script type="text/vbscript">
4
<!--
5 6 7 8 9 10 11
Dim counter

counter = 1

Sub ok(b,m)
    Call external.ok(b,m)
End Sub
12
-->
13 14 15 16
</script>
<script>
' Verifies that we're in VBScript although there is no type specified
If true then counter = counter+1
17 18 19
function inccounter(x)
    counter = counter+x
end function
20 21 22
</script>
<script type="text/javascript">
// We're in javascript
23 24 25 26
try {
    counter++;
    incCounter(2);
}catch(e) {
27
    ok(false, "got an exception " + e.message);
28
}
29
</script>
30
<script>
31 32 33 34
' And back to VBScript
If true then counter = counter+1

Sub runTest()
35
    Call ok(counter = 6, "counter = " & counter)
36
    Call ok(isNull(document.onkeyup), "document.onkeyup is not null")
37
    Call ok(document.formname.tagName = "FORM", "document.form.tagName = " & document.formname.tagName)
38
    Call ok(formname.tagName = "FORM", "form.tagName = " & formname.tagName)
39 40 41
    Call external.reportSuccess()
End Sub
</script>
42 43
<script type="text/javascript">
// We're in javascript
44
</script>
45
<body onload="If true then runTest()">
46
<form name="formname"></form>
47 48
</body>
</html>