3

Looking at getting a current website site am working on fully HTML5 validated using W3C

This is the Google map API Javascript tag that is failing to validate.

<script src="http://maps.googleapis.com/maps/api/js?libraries=places&sensor=false"></script>

This is the response from W3C

& did not start a character reference. (& probably should have been escaped as &.)

It does not like the & when defining if the sensor is true or false.

I have tried the following

<script src="http://maps.googleapis.com/maps/api/js?libraries=places&ampsensor=false"></script>

When running the page i get a Error from the API explaining i have not used &sensor and it needs to be set to true or false.

Anyone have any ideas how to overcome this please.

Thanks in advance.

4

2 回答 2

4

我想你只是忘了在后面加分号&amp;

<script src="http://maps.googleapis.com/maps/api/js?libraries=places&amp;sensor=false"></script>

应该管用

于 2013-09-24T10:53:21.530 回答
-1
 <script type="text/javascript"
      src="https://maps.googleapis.com/maps/api/js?key=API_KEY&sensor=SET_TO_TRUE_OR_FALSE">

所以你需要先从这里获取 API_KEY 。

于 2013-09-24T11:00:40.823 回答