Google地图 - 资源解释为脚本,但以MIME类型image / png传输 [英] Google Maps - Resource interpreted as Script but transferred with MIME type image/png

查看:611
本文介绍了Google地图 - 资源解释为脚本,但以MIME类型image / png传输的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做了一些调查,但找不到针对Google Maps V3 Javascript API的帖子,所以我发布了一个新问题。请让我知道是否有更适合这个问题的地方。



我的问题:



没有触及任何东西,我的网站利用Google Maps V3 JavaScript API开始给我这个错误:

 资源解释为脚本,但与MIME类型的图像/ PNG 

转移拒绝从http://mt1.googleapis.com/vt?pb=!1m4!1m3!1i15!2i9148!3i11958执行脚本!1M41立方米1i15 2 ... 2M1 1e4712立方米1E37 2M1 1ssmartmaps 4E3&安培;!!!!!回调= _xdc _._ 63mj9u&安培;标记= 110320' ,因为它的MIME类型( '图像/ PNG')不是可执行文件,和严格的MIME类型检查已启用。

我开始在Chrome的javascript控制台中完全明白这一点。这可能与对Google地图的太多请求有关吗?我在地图页面上做了一些修补,刷新频率很高,但从未触及任何处理地图或其贴图呈现方式的工作脚本 - 所以我非常困惑。



有没有人遇到此问题和/或知道解决方案?

更新
正如下面的评论所暗示的那样,这不是一个可忽略的问题,因为它影响着地图图块的渲染方式。其他人则开始遇到这样的问题,以及,在的这篇文章。这也是一个影响我在其他网站上发起的其他地图的问题(示例)。

解决方案

我在Google地图中打开了一个问题,并得到了答案:



使用htttp协议的此API的地址存在问题。替换为https即可使用。



例如:' https ://maps.googleapis.com/maps/api/js?v = 3 '


I did some research and I couldn't find a post that was specific to the Google Maps V3 Javascript API, so I'm posting a new question. Please let me know if there is a more appropriate place for this question.

My Issue:

Without touching anything, my website, utilizing the Google Maps V3 Javascript API, started giving me this error:

Resource interpreted as Script but transferred with MIME type image/png

Refused to execute script from 'http://mt1.googleapis.com/vt?pb=!1m4!1m3!1i15!2i9148!3i11958!1m4!1m3!1i15!2…2m1!1e47!12m3!1e37!2m1!1ssmartmaps!4e3&callback=_xdc_._63mj9u&token=110320' because its MIME type ('image/png') is not executable, and strict MIME type checking is enabled. 

I started getting this in Chrome's javascript console completely out of the blue. Could this be related to too many requests to Google Maps? I was doing some tinkering on the map page and refreshing somewhat frequently, but never touched any of the working script dealing with how the map or its tiles are rendered - so I'm very confused.

Has anyone run into this issue and/or know of a solution?

UPDATE As implied in a comment below, this is not an 'ignorable' issue as it is affecting how the map tiles are rendered. Others are beginning to experience this kind of issue as well, as noted in this post. It is also an issue that is affecting other maps I've initiated on other websites (example).

解决方案

I'm had open a issue in google maps and i got the answer:

There is a problem with the address of this api using htttp protocol. Replace with https that will work.

ex: 'https://maps.googleapis.com/maps/api/js?v=3'

这篇关于Google地图 - 资源解释为脚本,但以MIME类型image / png传输的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆