user3228865
user3228865

Reputation: 43

Error in coding on geolocation

what is wrong with this code? lines 2 and 7 apparently have errors? Thanks

var location = Appery ('input').val();
if (location == '') {
   alert ('Please enter a location.');
   return;
}
var map = Appery('map');
map.options['address'] = location;
map.refresh();

Upvotes: 0

Views: 82

Answers (1)

ndpu
ndpu

Reputation: 22571

You cant use name location for your variable!

The Window.location is read-only property, returns a Location object with information about the current location of the document.

Change it to something different:

var appery_loc = Appery('input').val();

Upvotes: 1

Related Questions