XML Parsing Error: not well-formed in FireFox but good in Chrome

前端 未结 2 1311
清歌不尽
清歌不尽 2020-12-31 02:41

I using jQuery Ajax like below:

$.ajax({
url: \'servlet/*****Servlet\',
      dataType: \"text\",
      success: function(data) {
        var subareaCoo         


        
2条回答
  •  臣服心动
    2020-12-31 03:22

    Your server is not returning a content-type, so Firefox assumes that since this is _XML_HttpRequest your response might be XML and tries to parse it. When that fails, it stops trying and reports that this wasn't XML after all.

    Chrome likely does the same but doesn't report anything.

    I suggest actually sending a Content-Type header indicating what your data is.

提交回复
热议问题