Skip to content

Commit

Permalink
Load bugs ajax call
Browse files Browse the repository at this point in the history
  • Loading branch information
samcroft committed Sep 27, 2012
1 parent bc265c4 commit 509061f
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions www/js/index.js
Expand Up @@ -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('<li>'+item.title)
});
},
error: function(data) {
bugs.append('<li>There was an error loading the bugs');
}
});
}

loadBugs();

});

0 comments on commit 509061f

Please sign in to comment.