<script type="text/javascript"> $(document).ready(function () { $.each(($.browser), function (i, val) { }); $("#btnlookup").click(function () { lookup(); }); }); if (!$.browser.msie) {alert('this utility is available only for IE, please try JSONP for other browsers'); return; }var addressURL = "http://maps.googleapis.com/maps/api/geocode/xml?address=" + $("#txtAddress").val() + "&sensor=false"; alert(addressURL); $("#output").text(""); $.ajax({ url: addressURL, dataType: "xml", success: function (response) { if (!$.isXMLDoc(response)) { var outputStr = "Result is not valid XML Format"; $(outputStr).appendTo($("#output")); } $.each($(response).find('result'), function () { var outputStr = ""; $(outputStr).appendTo($("#output")); }); }, //sccess error: function (response) { var outputStr = "" + response.status + ""; $(outputStr).appendTo($("#output")); } }//ajax options ); } script>
Monday, January 17, 2011
JQuery XML parsing
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment