百度地圖引用時 報出A Parser-blocking, cross site (i.e. different eTLD+1) script

頁面引入百度地圖api時chrome

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改爲了api

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

錯誤便消失了url

相關文章
相關標籤/搜索