日期:2014-05-16 浏览次数:20773 次
Response.ContentEncoding = System.Text.Encoding.UTF8; string xmls = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\r\n"; xmls += "<apps>\r\n"; xmls += " <app>\r\n"; xmls += " <zp_id>1</zu_id>\r\n"; xmls += " </app>\r\n"; xmls += "</apps>\r\n"; Response.ContentType = "text/xml"; Response.Charset = "UTF-8"; Response.AddHeader("Content-Disposition", "attachment;filename=\"apps.xml\""); Response.Write(xmls); Response.Flush(); Response.End();
var xhr = new XMLHttpRequest(); xhr.open("GET", "apps.aspx", true); xhr.send(null); xhr.onreadystatechange = function(){ if(xhr.readyState == 4) { xmlDoc_3 = xhr.responseXML.documentElement; //到这里chrome中就会出"Cannot read property 'documentElement' of null的错误" } };