I'm grabbing an XML file with jQuery like this:

$(document).ready(function(){
    $.ajax({
        type: "GET",
        url: "http://ipinfodb.com/ip_query.php?ip=74.125.45.100";,
        dataType: "xml",
        success: function(xml) {
            //$(xml).find().each(function(){
                var city = $(xml).find("City").text();
                /*
                $('<div class="items" id="link_'+id+'"></div>').html
('<a href="'+url+'">'+title+'</a>').appendTo('#page-wrap');
                $(this).find('desc').each(function(){
                    var brief = $(this).find('brief').text();
                    var long = $(this).find('long').text();
                    $('<div class="brief"></div>').html(brief).appendTo
('#link_'+id);
                    $('<div class="long"></div>').html(long).appendTo
('#link_'+id);
                });
                */
                alert(city)
            //});
        }
    });
});

The XML file looks like this
<?xml version="1.0" encoding="UTF-8"?>
<Response>
        <Ip>74.125.45.100</Ip>
        <Status>OK</Status>
        <CountryCode>US</CountryCode>
        <CountryName>United States</CountryName>
        <RegionCode>06</RegionCode>
        <RegionName>California</RegionName>
        <City>Mountain View</City>
        <ZipPostalCode>94043</ZipPostalCode>
        <Latitude>37.4192</Latitude>
        <Longitude>-122.057</Longitude>
        <Timezone>-8</Timezone>
        <Gmtoffset>-8</Gmtoffset>
        <Dstoffset>-7</Dstoffset>
</Response>

But I can't get it to pull the data out.

Reply via email to