I am having a problem with that preview tab in network section. When HTML is returned I am seeing the raw HTML in both preview and response. Sometimes, but very rarely, I HTML is rendered properly in Preview tab.
Am I doing something wrong or it's just some Chrome bug?
Thanks
Problem is solved when you add a proper
Content-Type
header. If itstext-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 toapplication/json
and its nicely formatted now.I was testing this as well. What did it for me was adding the http header.
Then of course some proper markup formatting. But the status code was what I needed to convince chrome to render the preview.