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

前端 未结 2 1304
清歌不尽
清歌不尽 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 02:57

    Just Add this code. The problem is the server did not specify the mime type and firefox takes it to be xml. This code will specify what Mime type the xhr response is going to be.

    beforeSend: function(xhr){  xhr.overrideMimeType( "text/plain; charset=x-user-defined" );},
    

提交回复
热议问题