Code:
onClick: function () {
$.ajax({
type: 'POST',
url: 'data.php',
dataType: 'json',
success: function (data) {
var res = [];
for (var i in data)