jQuery Ajax call No element found issue

前端 未结 6 1977
清歌不尽
清歌不尽 2020-12-17 09:33

I am getting a javascript error on firefox 3.5, when trying to call an ajax method.

Please find the error below:

XML Parsing Error: no element found          


        
6条回答
  •  抹茶落季
    2020-12-17 10:03

    The ajax call expects XML back (perhaps due to bad guessing) and tries to parse it and fails if nothing is returned or it is not valid XML..

    Use the dataType option to specify the format of the response.


    From the comments it looks like some browsers cannot handle an no-content response. So, a workaround for such cases might be to return something from your service (even a single space).

提交回复
热议问题