Seek and destroy has been running really well on our site for some time, however it's stopped working all of a sudden.
There seems to be a reference to http://j.maxmind.com/app/geoip.js in seek and destroy and the file is coming back with a 404 error which is causing the page to break.
Anyone have the same issue. Any ideas on how to resolve.
I removed the maxmind script and updated some of the code to use geolocation and it works fine. Not quite a well as using the maxmind geoip script because the user has to accept the request to get thier location, but still works fine.
I've used open street maps, to pull the postcode from thier location to use as the address
I had previously modified the original script a while back, so not sure if its much different than the stock code, but it should be able to help you update your site.
at the beginning of the inline script:
var map;
var geocoder;
var markers = new Array();
var address = '';
//$('#address').val(geoip_city() + ", " + geoip_country_name());
//var address = $('#address').val();
if (address != '') {
gmap_location_lookup(address);
}else{
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(position){
$.ajax({
dataType: "json",
url: "http://nominatim.openstreetmap.org/reverse?format=json&lat="+position.coords.latitude+"&lon="+position.coords.longitude+"&zoom=18&addressdetails=1",
data: {},
success: function(data){
address = data.address.postcode;
$("#address").val(address);
gmap_location_lookup(address);
}
});
}, function(error){
},{
enableHighAccuracy: false
});
}
}
Ok we changed to a different lib with minimal change. Just removed the reference to the maxmind lib and then updated the code as follows (red is removed, green is added):
and then later update this line with the new function name:
geocoder.geocode({ 'address': address, 'region': countryCode }, function (results, status) {
I think what I've got will do for what I need, but your solution does looks like a better solution. I'll check out ip-api.com for future projects as it looks good.
Stopped working - 404 on external .js reference
Hi,
Seek and destroy has been running really well on our site for some time, however it's stopped working all of a sudden.
There seems to be a reference to http://j.maxmind.com/app/geoip.js in seek and destroy and the file is coming back with a 404 error which is causing the page to break.
Anyone have the same issue. Any ideas on how to resolve.
Thanks
David
Yes same here. Looks like it's a payed service now. Looking into other free services now. Will keep you posted.
Thanks, Yes looks like it.
I'm going to look at modifying it to use google maps geo location. I'll let you know how it goes.
Hi Yannick,
I removed the maxmind script and updated some of the code to use geolocation and it works fine. Not quite a well as using the maxmind geoip script because the user has to accept the request to get thier location, but still works fine.
I've used open street maps, to pull the postcode from thier location to use as the address
I had previously modified the original script a while back, so not sure if its much different than the stock code, but it should be able to help you update your site.
at the beginning of the inline script:
Hope that helps point you in the right direction.
Cheers,
Dave
Ok we changed to a different lib with minimal change. Just removed the reference to the maxmind lib and then updated the code as follows (red is removed, green is added):
and then later update this line with the new function name:
geocoder.geocode({ 'address': address, 'region': countryCode }, function (results, status) {
Thanks Yannick.
I think what I've got will do for what I need, but your solution does looks like a better solution. I'll check out ip-api.com for future projects as it looks good.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.