jquery ajax 加载xml文档
方法二
很多时候无法解析就是content-type的问题。如果本身就是xml文件,请跳过这一步。
动态生成的xml一定要将其设置为text/xml,否则默认就是text/html也就是普通的文本。 常见语言的content-type设置:
response.setheader("contenttype","text/xml"); //jsp教程
response.contenttype= "text/xml"; //asp教程
header("content-type:text/xml"); //php教程