0

Whenever i am using grunt build, absolute path script is being removed automatically, how to fix it.

Example:

 <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true&libraries=places&language=en-US"></script>

This external file script has been removed from my index html

how can it be fixed???

wassertim
  • 3,116
  • 2
  • 24
  • 39

1 Answers1

0

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 -->
Community
  • 1
  • 1
Vineet
  • 4,525
  • 3
  • 23
  • 42