dot*_*huZ 12 javascript xml jquery
我想通过AJAX发布XML结构来获取过滤结果集.web服务能够处理发布请求,但我的POST发生似乎有些问题.
$.ajax({
url: ajaxurl,
data: {
inputxml: escape('<test></test>') <- how to post xml structure correctly?
},
type: 'POST',
contentType: "text/xml",
dataType: "text",
success : parse,
error : function (xhr, ajaxOptions, thrownError){
alert(xhr.status);
alert(thrownError);
}
});
Run Code Online (Sandbox Code Playgroud)
XML:
<?xml version="1.0" encoding="UTF-8"?>
<f:filterChain
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:f="urn:foo">
<f:filter attributeId="number">
<f:rangeCondition conditionSign="INCLUSION" operator="BETWEEN">
<f:low>5</f:low>
<f:high>15</f:high>
</f:rangeCondition>
</f:filter>
</f:filterChain>
Run Code Online (Sandbox Code Playgroud)
谢谢
Raf*_*fay 35
$.ajax({
url: ajaxurl,
data: "<test></test>",
type: 'POST',
contentType: "text/xml",
dataType: "text",
success : parse,
error : function (xhr, ajaxOptions, thrownError){
console.log(xhr.status);
console.log(thrownError);
}
});
Run Code Online (Sandbox Code Playgroud)
看到这个答案可能有所帮助
| 归档时间: |
|
| 查看次数: |
68378 次 |
| 最近记录: |