-1

I made site and now when I'm tesitng this inside google PageSpeedInsights tool I have problem with Leverage Browser Caching for that same script.

This is my script that I'm calling inside HTML file

<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDktC0AXgcEZ5p9yN3RKLs_HCi6JKjZUeE&callback=initMap"></script

PageSpeedInsights show me this problem

https://maps.googleapis.com/…Z5p9yN3RKLs_HCi6JKjZUeE&callback=initMap (30 minuta)

Also when I watching errors in the console show me te warning for that same script. Now I'm thinking that i make something totally wrong.

This is error in console:

Uncaught InvalidValueError: initMap is not a function js?key=AIzaSyDktC0AXgcEZ5p9yN3RKLs_HCi6JKjZUeE&callback=initMap:95

Does anybody now what is the problem.

Thanks

duncan
  • 31,401
  • 13
  • 78
  • 99
Be Behind
  • 47
  • 10

1 Answers1

0

A similar issue was raised on this github project, in which they referenced a stackoverflow entry as a possible solution.

Make sure the initMap() is a global scoped function or the parameter passed to the Google Maps JS is properly namespaced.

Community
  • 1
  • 1
adjuremods
  • 2,938
  • 2
  • 12
  • 17