Now that SSL is encouraged for everyone and doesn’t have performance
concerns, this technique is now an anti-pattern. If the asset you need
is available on SSL, then always use the https:// asset.
Allowing the snippet to request over HTTP opens the door for attacks
like the recent Github Man-on-the-side attack. It’s always safe to
request HTTPS assets even if your site is on HTTP, however the reverse
is not true.
You should use this
<script type="text/javascript" src="//maps.google.com/maps/api/js?sensor=true&libraries=places&language=en-US"></script>
instead
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true&libraries=places&language=en-US"></script>
EDIT
There is an another way in grunt
. Please check out this URL
<!-- build:js({.tmp,dist,app}) /scripts/application.js -->
<!-- vendor, external -->
<script src="/maps.google.com/maps/api/js?sensor=true&libraries=places&language=en-US"></script>
<!-- endbuild -->