boomerkang
New Member
How does one set the onreadystatechange property if using an xmlhttp request asynchronously? My code:
Doing this results in a runtime error:
"Error occurred while accessing component property/method: onreadystatechange. Type mismatch."
I've tried everything I can think of. Any help would be appreciated...
Code:
DEFINE VARIABLE httpReq AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE l-url AS CHARACTER INIT 'http://www.google.com' NO-UNDO.
FUNCTION requestHandler RETURNS LOGICAL:
MESSAGE "httpReq:readyState =" httpReq:readyState VIEW-AS ALERT-BOX.
RETURN ?.
END FUNCTION.
CREATE 'microsoft.xmlhttp' httpReq.
httpReq:open('GET', l-url, TRUE).
httpReq:onreadystatechange = 'requestHandler'.
httpReq:setRequestHeader('Content-Type', 'text/xml').
httpReq:send().
Doing this results in a runtime error:
"Error occurred while accessing component property/method: onreadystatechange. Type mismatch."
I've tried everything I can think of. Any help would be appreciated...