Hi,
I'm trying to use jQuery to get the two-letter country abbreviation from a URL that does exactly this. You give the URL your IP address, and it spits you back the string.
Try it: http://nl.ae/iptocapi.php?type=1&ip=208.48.2.130
When I try to get this to display on my page using jQuery, however, all I am getting back as the "data" is "[object XMLHtttpRequest]". I am thinking this has something to do with the fact that it's not coming back as HTML? It's just "US" as a plain text string. Does this make a difference? Here's my code:
jQuery.ajax({
type:"GET",
url:"http://nl.ae/iptocapi.php",
datatype:"html",
data:{type:'1', ip:'208.48.2.130'},
complete:function( data ) {
alert( data );
}
});
Again, "data" is coming back as "[object XMLHtttpRequest]" instead of "US". What am I doing wrong?
Thanks,
Garrett