最近写代码的时候看见控制台报错,然后就是一顿百度最后终于发现了是百度api控件的问题

 报错代码

A parser-blocking, cross site (i.e. different eTLD+1) script, https://api.map.baidu.com/getscript?type=webgl&v=1.0&ak=8wiUDGrN9tceQGB4Nv0rlCbG1bUSn4KY&services=&t=20240116115527, 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.

解决方案

找到自己导入百度地图api的地方,然后把 api 修改成 getscript 即可

 

因为使用的地图比较简单,改了之后暂时没发现什么问题

这样就ok了 

Logo

加入社区!打开量化的大门,首批课程上线啦!

更多推荐