JQuery Ajax POST XML结构/filter链
我想通过AJAX发布XML结构来获取过滤结果集。 web服务能够处理发布请求,但我的POST发生似乎有些问题。
$.ajax({ url: ajaxurl, data: { inputxml: escape('') <- 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); } });
XML:
5 15
谢谢
$.ajax({ url: ajaxurl, data: " ", type: 'POST', contentType: "text/xml", dataType: "text", success : parse, error : function (xhr, ajaxOptions, thrownError){ console.log(xhr.status); console.log(thrownError); } });
看到这个答案可能有所帮助
jQuery ajax发布到Web服务
也许最好在对象中设置值,并通过将ajax方法的dataType设置为’xml’将该对象作为xml发送到服务器。