A
Admy
Unregistered / Unconfirmed
GUEST, unregistred user!
在网页中通过javascript很容易实现以下功能:
var xmlhttp=null;
function PostOrder(xmldoc)
{
var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP.5.0"
xmlhttp.Open("POST", "http://myserver/orders/processorder.asp", false);
xmlhttp.onreadystatechange= HandleStateChange;
xmlhttp.Send(xmldoc);
myButton.disabled = true;
}
function HandleStateChange()
{
if (xmlhttp.readyState == 4)
{
myButton.disabled = false;
alert("Result = " + xmlhttp.responseXML.xml);
}
}
在delphi 7中,xmlhttp被封装在IXMLHTTPREQUEST中,onreadystatechange、responseXML的类型是IDispatch,msxml文件中定义如下:
property onreadystatechange: IDispatch write Set_onreadystatechange;
property responseXML: IDispatch read Get_responseXML;
如何实现上述数据异步提交功能。
var xmlhttp=null;
function PostOrder(xmldoc)
{
var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP.5.0"
xmlhttp.Open("POST", "http://myserver/orders/processorder.asp", false);
xmlhttp.onreadystatechange= HandleStateChange;
xmlhttp.Send(xmldoc);
myButton.disabled = true;
}
function HandleStateChange()
{
if (xmlhttp.readyState == 4)
{
myButton.disabled = false;
alert("Result = " + xmlhttp.responseXML.xml);
}
}
在delphi 7中,xmlhttp被封装在IXMLHTTPREQUEST中,onreadystatechange、responseXML的类型是IDispatch,msxml文件中定义如下:
property onreadystatechange: IDispatch write Set_onreadystatechange;
property responseXML: IDispatch read Get_responseXML;
如何实现上述数据异步提交功能。