Javascript Archives - 7-Views

Reverse Geocoding – Get formatted address from latitude and longitude

Posted by
July 3, 2020

<script> function getmylocation(lat, lng) { var currAddress, addtress= []; var geocoder = new google.maps.Geocoder(); var latlng = new google.maps.LatLng(lat, lng); if (geocoder) { geocoder.geocode({‘latLng’: latlng}, function (results, status) { if (status == google.maps.GeocoderStatus.OK) { if (results[0]) { currAddress = results[0].formatted_address; addtress.push(currAddress ); } else { alert(‘No results found’); } } else { alert(‘Geocoder failed due […]

read more

Email Validation

Posted by
September 13, 2018

function validateEmail(email) { var re = /^(([^<>()\[\]\\.,;:\s@”]+(\.[^<>()\[\]\\.,;:\s@”]+)*)|(“.+”))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; return re.test(email); }  

read more