【问题标题】:script async defer undefined attribute name脚本异步延迟未定义的属性名称
【发布时间】:2019-01-18 19:44:50
【问题描述】:

我在 Eclipse Oxygen 中有一个 xhtml 文件

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 

我尝试使用

<script async="defer"
src="https://maps.googleapis.com/maps/api/js?key=...&amp;callback=initMap" type="">
</script>

但是我收到“未定义的属性名称(异步)”通知。我应该怎么做才能克服这个?

【问题讨论】:

  • async 只是 HTML 5 而不是 XHTML
  • 如果没有异步,谷歌地图功能是否正常?

标签: eclipse asynchronous xhtml deferred


【解决方案1】:

试试这个:

<script async="true" defer
src="https://maps.googleapis.com/maps/api/js?key=...&amp;callback=initMap" type="">
</script>

【讨论】:

    猜你喜欢
    • 2015-06-17
    • 2012-06-04
    • 2013-08-01
    • 1970-01-01
    • 2018-08-01
    • 1970-01-01
    • 2016-05-18
    相关资源
    最近更新 更多