jQuery Ajax call returning '[object XMLDocument]'

后端 未结 5 482
闹比i
闹比i 2021-02-01 23:06

I have an HTML page which I want to populate using Ajax. I\'ve copied code from other pages, (which are all in PHP, and I\'m not sure if that matters), and it\'s returning

5条回答
  •  日久生厌
    2021-02-02 00:03

    try to set the content type of response to text/html first then say echo "ok" like this:

    header('Content-type: text/html');
    

    I got the same problem here and it solved this way only, since when we does not specify the content type of the response every browser treats the response in different format as and so.

提交回复
热议问题