Created
December 18, 2012 16:32
-
-
Save giupo/4329480 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> | |
</head> | |
<table id="mytable"> | |
</table> | |
<script> | |
var d = null; | |
$.ajax({ | |
url: '<url>', | |
type: 'GET', | |
dataType: 'json', | |
success: function(data, textStatus, xhr) { | |
var table = $('table#mytable'); | |
table.empty() | |
var html = $.map(data, function(element, index) { | |
return "<tr>"+ | |
"<td>" + element["sent"] + "</td>"+ | |
"<td>" + element["error_description"] + "</td>"+ | |
"<td>" + element["to"] + "</td>"+ | |
"<td>" + element["cc"] + "</td>" | |
"</tr>"; | |
}); | |
table.html(html.join("")); | |
}, | |
error: function(xhr, textStatus, errorThrown) { | |
//handle error | |
} | |
}); | |
</script> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment