Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

type mismatch when doing xmldoc.onreadystatechange = getRef("Handler")

Status
Not open for further replies.

mike1999

Technical User
Nov 17, 2004
1
US
Please help!!

I have a server side vbscript doing the asynchronous xml load. The following is the code. But when I run it, i keep getting the following error in the line calling the getRef function (xmlDoc.onreadystatechange = GetRef("foo_onreadystatechange")):

Microsoft VBScript runtime error '800a000d'
Type mismatch: '[undefined]'

Can someone help me? I can't find out why there is a mismatch.
=====the following is the code===
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0"> <TITLE></TITLE> </HEAD> <BODY>

<P>this is the test</P>

<SCRIPT LANGUAGE="VBScript" RUNAT=SERVER>
Dim ready_flag
ready_flag = 0

set xmlDoc = Server.CreateObject("Msxml2.DOMDocument.4.0")
xmlDoc.async = true
xmlDoc.onreadystatechange = GetRef("foo_onreadystatechange")
xmlDoc.Load "book.xml"

sub foo_onreadystatechange
if xmlDoc.readyState = 4 then
ready_flag = ready_flag or 1
response.write "xmlDoc finished<br>"
end if
end sub
</SCRIPT>

 
What is the data type of the return value of the GetRef function ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Hello mike1999,

Do this instead?
[tt]
[red]set[/red] xmlDoc.onreadystatechange = GetRef("foo_onreadystatechange")
[/tt]
regards - tsuji
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top