Chrome,Safari,Firefox不同地输出XML [英] Chrome, Safari, Firefox outputs XML differently

查看:129
本文介绍了Chrome,Safari,Firefox不同地输出XML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个好奇的问题。我正在查看XML文件,所以我做了这个twitter搜索:
http: //search.twitter.com/search.atom?q=basketball



Chrome的输出如下所示:

Firefox的输出如下所示:

然后, Safari的输出如下所示:


我的问题是,是怎么回事?我怎样才能让浏览器以不同的形式显示。换句话说,如果我想输出<?xml ... ,我该怎么做?

<?xml ... ,请发送一个标题让浏览器认为它是一个文本文件,而不是一个XML文件:

  Content-Type:text / plain 


I have this curious question. I was looking at XML files and so I did this twitter search: http://search.twitter.com/search.atom?q=basketball

The output for Chrome looks like this:

The output for Firefox looks like this:

Then, the output for Safari looks like this:

My question is, what is going on? How can I get the browser to display it in different forms. In other words, if I want to output the <?xml ..., how can I do that?

解决方案

If you want the browser to output the <?xml ..., send a header that makes the browser think it's a text file, not an XML file:

Content-Type: text/plain

这篇关于Chrome,Safari,Firefox不同地输出XML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆