Google Maps are not showing with domainname.com

匿名 (未验证) 提交于 2019-12-03 02:03:01

问题:

JavaScript:

 

JavaScript Function:

 

I reads following questions but my problem is not solved.

Google Maps JavaScript API RefererNotAllowedMapError

Google maps API referrer not allowed

Google Maps API error: Google Maps API error: RefererNotAllowedMapError

The problem is , when i open my website like this.

http://mysiste.com/contactus 

it is not showing map and showing following error.

Google Maps API error: RefererNotAllowedMapError https://developers.google.com/maps/documentation/javascript/error-messages#referer-not-allowed-map-error Your site URL to be authorized: http://comprettainsurance.com/contactus"

while if i open my site like this.

http://www.mysiste.com/contactus 

the maps are working perfectly.

My Credential Page where i add domain like this.

so why it is not showing maps without www?

回答1:

*.comprettainsurance.com/* does not match http://comprettainsurance.com/contactus (it matches any subdomain of comprettainsurance.com, but not the domain itself).

You need to add an additional referrer line:

comprettainsurance.com/* 


回答2:

Use simple like this this worked for me everywhere

 

when you use defer the script will be loaded when the document is closed- the content has been loaded. Furthermore external deffered scripts will be parsed after inline defferred scripts.



易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!