dataType应该是您收到的内容的类型,但
contentType应该是您要发送的内容的哑剧类型,以下应该可以:
$(document).ready(function() { $.ajax({ type: "POST", url: "/getprojects.ashx", data: "<formData client="" year="" categories="" tags="" freeText="" count="34" page="1"></formData>", contentType: "text/xml", dataType: "xml", cache: false, error: function() { alert("No data found."); }, success: function(xml) { alert("it works"); alert($(xml).find("project")[0].attr("id")); } }); });
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)