I am trying to display JSON data on a list but my javascript code gets stuck in the middle of wlCommonInit() function.
function wlCommonInit(){
WL.Logger.debug("inside the wlcommoninit");
busyIndicator = new WL.BusyIndicator('AppBody');
var $list = $("ul#myList");
$list.append('<li> ' + "resrere" +
'</li>');
getData();
$list.append('<li> ' + "resrere" +
'</li>');
}
function getData() {
$.mobile.showPageLoadingMsg();
WL.App.overrideBackButton (function(){WL.App.close();});
var invocationData = {
adapter : 'StudentInfo',
procedure : 'getStudentInfos'
};
WL.Client.invokeProcedure(invocationData,{
onSuccess : loadFeedsSuccess,
onFailure : getDataFailure,
});
}
function loadFeedsSuccess(result){
if (!result || !result.invocationResult || !result.invocationResult.items || result.invocationResult.items.length == 0)
alert("Could not retrieve feeds");
feeds = result.invocationResult.items;
$("ul#myList").empty();
for (var i=0; i<feeds.length; i++){
var dataItem = feeds[i];
var listItem = $("<li>" + dataItem.question + "</li>");
$("ul#myList").append(listItem);
}
}
In this code, it sticks at getData();
it displays the first "resrere" but it does not display second "resrere". I can not find the problem, so I can not create any solution. Thanks for your help.