0
点赞
收藏
分享

微信扫一扫

Ajax实例(二)-使用XML传送数据


只需要多zipCode(zipCode)函数进行改进

function zipCode(zipCode){
var xmlString="<location> <zipCode>"+zipCode+"</zipCode></location>";//xml文件片段
xmlHttpRequest.open("POST",url,true);
xmlHttpRequest.setRequestHeader("Content-Type","text/xml");//告诉服务器以XML格式发送数据
xmlHttpRequest.send(xmlString);
}

举报

相关推荐

0 条评论