[thelist] MSXML DOMDocument: Asynchronous?
phil crawford
crawford_phil at hotmail.com
Mon Apr 22 15:17:00 CDT 2002
>From: "Tab Alleman" <Tab.Alleman at realmetros.com>
> Anyone successfully used this object asynchronously?
>Here's the code I'm using, but according to what I'm printing on the
>screen, the readystate of the object starts at 3 and stays that way the
>whole time, apparently no matter how long I wait.
>
><%
>OPTION EXPLICIT
>GetStr =
>"http://res.amadeus.net/pl/tab/us/a.xmt?SESSION_ID=&FCT=HARA0&LANGUAGE=U
>S&SITE=RMC&CAPLUS_INDICATOR=TRUE" & _
>
>"&HOTEL_CODE=ISM524&HOTEL_CHAIN_CODE=DI&IN_DATE=20020502&OUT_DATE=200205
>03&OCCUPANCY=2"
>
>Dim xmlRoomAvail
>Set xmlRoomAvail = CreateObject("msxml2.DOMDocument.4.0")
>xmlRoomAvail.async = true
>xmlRoomAvail.load GetStr
>
>FOR i = 0 TO 400000
> Response.Write("<h3>ReadyState " & i & " = " &
>xmlRoomAvail.ReadyState & "</h3>")
> IF xmlRoomAvail.ReadyState = 4 THEN
> Exit FOR
> END IF
>NEXT
>
>Response.Write("<h3>Debug: " & Server.HTMLEncode(xmlRoomAvail.xml) &
>"</h3>")
>Response.Write("<h3>i = " & i & "</h3>")
>Set xmlRoomAvail = Nothing
>
Can you use the waitForResponse method?
If xmlRoomAvail.readyState <> 4 then
xmlRoomAvail.waitForResponse X
End If
to wait X seconds?
-phil
_________________________________________________________________
MSN Photos is the easiest way to share and print your photos:
http://photos.msn.com/support/worldwide.aspx
More information about the thelist
mailing list