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

前端之家收集整理的这篇文章主要介绍了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.f2er.com/html/230488.html

猜你在找的HTML相关文章