The Achievement module
The Achievement module has the same flow as other modules. We make another Ajax call to ajax_handler.php to build this module. Notice that in the callback function from the Ajax call, a data is written in JavaScript Object Notation (JSON). We need to loop this JSON object to actually access the achievement data. We also need to dynamically build an HTML table that will hold the achievement images. Finally, we append the HTML that we have constructed to the MyAchievements div:
function GetMyAchievements(){ var action='GetMyAchievements', player=getFromLocalStorage('player'), html="<table style=\"margin:0 auto;\">"; $.ajax({ dataType: "json", data: {action:action,player:player}, url: $AJAXHANDLER, success: function (data) { var Achievements = data[0].BadgesEarned.split(','); for (var i = 0; i < Achievements.length; i++) { AchievementId=Achievements[i]; html+='<tr>'; html+='<td><a href...