Reputation: 150
This simple code works in Chrome (displays your IP) but not in Firefox returns the following error :
"An error occured: 404 error".
<script>$(document).ready(function()
{
$.ajaxSetup({cache: false});
$.ajax({
url: "https://freegeoip.net/json/",
dataType: "JSONP",
error: function(xhr)
{
console.log("An error occured: " + xhr.status + " " + xhr.statusText);
},
success: function(data)
{
console.log(data.ip);
}
});
});
</script>
Here's the fiddle: https://jsfiddle.net/7ayo52Lx/5/
Any help is appreciated.
Upvotes: 1
Views: 162
Reputation: 150
OK, I found my stupid mistake and maybe it will help others: My addblocker blocked the request.
Case solved.
Upvotes: 1