Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
为什么谷歌不支持带有&;的有效URL;amp;在查询字符串中?_Url_Url Encoding_Google Static Maps - Fatal编程技术网

为什么谷歌不支持带有&;的有效URL;amp;在查询字符串中?

为什么谷歌不支持带有&;的有效URL;amp;在查询字符串中?,url,url-encoding,google-static-maps,Url,Url Encoding,Google Static Maps,尝试使用W3C验证程序验证以下HTML将抛出3个错误(截至2013年10月30日): 这将返回一个由Google声明的错误: Google Maps API服务器拒绝了您的请求。无效的请求。缺少“size”参数 为什么Google静态地图API不支持带有的有效URL&?您正确地转义了&字符 请注意,您不能将带有转义符号的URI直接输入到浏览器的地址栏中。它仅在HTML中使用时有效(即在href和src属性中) 完美的链接(以及图像) 请注意,您可能需要使用这些符号(因为它们似乎是明确的)

尝试使用W3C验证程序验证以下HTML将抛出3个错误(截至2013年10月30日):

这将返回一个由Google声明的错误:

Google Maps API服务器拒绝了您的请求。无效的请求。缺少“size”参数


为什么Google静态地图API不支持带有
的有效URL&

您正确地转义了
&
字符

请注意,您不能将带有转义符号的URI直接输入到浏览器的地址栏中。它仅在HTML中使用时有效(即在
href
src
属性中)

完美的链接(以及图像)



请注意,您可能需要使用这些符号(因为它们似乎是明确的);但是为了安全起见,只需将它们全部转义。

看起来Google现在支持
img
src属性中的转义
&
字符。
<!DOCTYPE html>
<head><title>asdf</title></head>
<img src="http://maps.googleapis.com/maps/api/staticmap?zoom=13&size=279x183&markers=50.916780,5.347420&sensor=false" alt="map">
<img src="http://maps.googleapis.com/maps/api/staticmap?zoom=13&amp;size=279x183&amp;markers=50.916780,5.347420&amp;sensor=false">