diff --git a/www/js/index.js b/www/js/index.js index 6140331..6743517 100755 --- a/www/js/index.js +++ b/www/js/index.js @@ -18,3 +18,28 @@ var app = { completeElem.className = completeElem.className.split('hide').join(''); } }; + +$(function(){ + + function loadBugs() { + var bugs = $('#bugs ul'); + + $.ajax({ + type: 'GET', + url: 'http://localhost/bapp/bugs.php?&jsoncallback=?', + dataType: 'JSONp', + timeout: 5000, + success: function(data) { + $.each(data, function(i,item){ + bugs.append('
  • '+item.title) + }); + }, + error: function(data) { + bugs.append('
  • There was an error loading the bugs'); + } + }); + } + + loadBugs(); + +}); \ No newline at end of file