JQuery AJAX get request - cannot see returned data

I think I'm missing something obvious here, but I can't figure it out. I expect the following HTML to alert the response from the server. But the warning is empty. I see in Wireshark that the expected response is coming back to me from the server. Why is it not populated in the data variable?

<html>
<head>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
</head>
<body>
<script type="text/javascript">
  $.get("http://www.geocommunicator.gov/TownshipGeocoder/TownshipGeocoder.asmx/GetTRS",
        {'Lat': 41,
         'Lon': -93,             
         'Units': 'eDD',
         'Datum': ''},      
        function(data) {
            alert('data:'+data);
        });
</script>
</body>
</html>
+3
source share
1 answer

Cross-site protection.

You will need to use jsonp.

+1
source

Source: https://habr.com/ru/post/1745508/


All Articles