Chrome -> Inspect element -> Network (XHR) -> Preview Tab (HTML) issue

佐手、 提交于 2019-12-03 14:24:13

I was testing this as well. What did it for me was adding the http header.

header('HTTP/1.1 500 Internal Server Error');

Then of course some proper markup formatting. But the status code was what I needed to convince chrome to render the preview.

Problem is solved when you add a proper Content-Type header. If its text-html then it will display content like it would be normal text no matter what do you send from server. I had the same problem and solved it by force'ing output type in $.ajax options. When i changed it to application/json and its nicely formatted now.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!