百度地图引用时 报出A Parser-blocking, cross site (i.e. different eTLD+1) script

来源:互联网 发布:扑克识别软件下载 编辑:程序博客网 时间:2024/06/02 05:53

页面引入百度地图api时

chrome控制台报出问题
A Parser-blocking, cross site (i.e. different eTLD+1) script, http://api.map.baidu.com/getscript?v=2.0&ak=Kpjp7jddqVUhWK5VkrfNt3YNezY88NtR&services=&t=20170517145936, is invoked via document.write. The network request for this script MAY be blocked by the browser in this or a future page load due to poor network connectivity. If blocked in this page load, it will be confirmed in a subsequent console message.See https://www.chromestatus.com/feature/5718547946799104 for more details.
(anonymous) @ api:1

查了一些资料,大概意思是说 :页面渲染完成后使用了document.write()
这是不被允许的,
根据上面的提示,把api引用url改成了

http://api.map.baidu.com/getscript?v=2.0&ak=Kpjp7jddqVUhWK5VkrfNt3YNezY88NtR&services=&t=20170517145936

错误便消失了

原创粉丝点击