';
- html += '
'
- +location.latitude
- +', '
- +location.longitude
- +' - ';
-
- if (politics == null) {
- html += "NA";
- } else {
+ var location = info['location'];
+ var politics = info['politics'];
+
+ var html = '
';
+ html += '
'
+ +location.latitude
+ +', '
+ +location.longitude
+ +' - ';
+
+ if (politics == null) {
+ html += "NA";
+ } else {
+
+ for (var politicsIndex in politics) {
+ var politic = politics[politicsIndex];
- for (var politicsIndex in politics) {
- var politic = politics[politicsIndex];
+ var name = politic['name'];
+ var code = politic['code'];
+ var type = politic['friendly_type'];
- var name = politic['name'];
- var code = politic['code'];
- var type = politic['friendly_type'];
-
- html +=
- '('
- +name
- +', '
- +code
- +', '
- +type
- +') ';
- }
- }
- html += '
'
-
- $('#location2politicsresults').append($(html));
+ html +=
+ '('
+ +name
+ +', '
+ +code
+ +', '
+ +type
+ +') ';
+ }
}
- },
- error: function(jqXHR, textStatus, errorCode) {
- $('#location2politicsresults').text('Error: '+textStatus);
- },
- dataType: 'jsonp',
- crossDomain: true
- });
-
+ html += '
'
+
+ $('#coordinates2politicsresults').append($(html));
+ }
+ })
});
});