The following code looks up a user's city from their IP address.
jQuery(document).ready(function($) {
var message = '';
$.ajax({
url: 'http://ift.tt/1In4Efd',
type: "GET",
success: function(result) {
message = result.city + ' - ';
}
})
.always(function(){
$('.location span').html(message);
});
});
It works find except in Safari where it gives the error...
Refused to set unsafe header "Access-Control-Request-Headers" Failed to load resource: Request header field Cache-Control is not allowed by Access-Control-Allow-Headers.
How can I fix this?
Aucun commentaire:
Enregistrer un commentaire