Google is not defined. JSHint Error

geocode : functions()
  new google.maps.Geocoder().geocode( { address: addy }, deferred.resolve ); 
  return ...;

I tried adding following script to index.html

<script type="text/javascript" src=""> </script>

Can anyone help me what is wrong in here ?


jshint doesn’t exactly have access to the “magic” of the framework. In general, you can let JSHint (or I use JSLint, but close enough) know that are some globals that it can ignore and just trust you. You can add this:

/*global Google */

to the top of your file and it should make JSHint feel better.


Thanks. It worked. It make sense that if you are using any global like google, setInterval(), clearInterval() JSHint is not smart enough to recognize those. So, if we use any global we have to add to JSHint manually. I was doing, window.setInterval(), window.clearInterval(). That approach also works but I like JSHint approach better.


great! glad it worked.