微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

html – 为什么Twitter和Google API文档在URL中编码&符号?

have read我应该把&& amp; amp;在HTML中.
然而,来自受尊敬的公司的许多代码示例不知何故忘记这样做.

只是我头顶的几个例子:

Google Web Fonts样品代码

<link href='http://fonts.googleapis.com/css?family=PT+Sans&subset=latin,cyrillic' rel='stylesheet' type='text/css'>

Google Maps文件

<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false&language=ja">

Twitter Anywhere官方教程:

<script src="http://platform.twitter.com/anywhere.js?id=YOUR_API_KEY&v=1" type="text/javascript"></script>

有没有真正的好处,没有逃避和符号的链接
这与浏览器怪癖有关吗?这只是文档中的错误吗?

Dear answerers,please make sure you’re answering the right question.

I kNow I should escape ampersands per spec. I also kNow why the mechanism was invented in the first place. I’m not 07004. My question is:

Is there a reason API documentation by respectable companies often violates this rule?

解决方法

Is there any real benefit from not escaping ampersand in links?

它节省了一些按键.

Is this related to browser quirks?

没有

Is this just a mistake in documentation?

Is there a reason API documentation by respectable companies often violates this rule?

无知和/或懒惰.浏览器执行错误恢复,以免他们注意到错误或者他们不在乎.文档可能不是由他们的最佳专家撰写.

原文地址:https://www.jb51.cc/html/230488.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐