javascript - How To Loop through result.invocationResult.resultSet in IBM worklight -



javascript - How To Loop through result.invocationResult.resultSet in IBM worklight -

everything works except display function . in display function trying access field name resultset not working.

function succ(result) { alert("connected"); var = result.invocationresult.resultset[1].name; $("#fetcharr").val(a); alert("connectedlll"); display(result.invocationresult.resultset); alert("the end"); }

display function is:

function display(items) { alert("heelo"); for(var j in items ) { var = j.name; alert(a); } }

why need 2 functions here? anyway, loop through resultset can utilize for loop so:

function succ(result) { (var = 0; < result.invocationresult.resultset.length; i++) { display(result.invocationresult.resultset[i]); // current result, example: $("#someidinthehtml").append("<p>name: " + result[i].name + "</p>"); }; }

you want search through "worklight-adapters" tag, has been asked many times in various forms.

javascript worklight worklight-adapters

Comments

Popular posts from this blog

model view controller - MVC Rails Planning -

ruby on rails - Devise Logout Error in RoR -

html - Submenu setup with jquery and effect 'fold' -