call back in enyo

Hello

my problem is that i can not use call back in my code . i don't know how can i use it ?
in my code :https://jsfiddle.net/y3d3cc3L/6/
in module.exports i wrote some code for loginPage after i clicked the button in ligon page i want to go to home panel
i have some request in module.exports such as :
 var xmlHttp = new XMLHttpRequest();<br />		xmlHttp.onreadystatechange = function() {<br /><br />			if (this.readyState = 4 && this.status == 200) {<br />				obj = JSON.parse(this.responseText);<br /><br />				for (indexOfItems = 0; indexOfItems < obj.result.items.length; indexOfItems++) {<br />					for (j = 0; j < 6; j++) {<br />						urlList[k] = obj.result.items[indexOfItems].Content[j].image.url;<br />						titleList[k] = obj.result.items[indexOfItems].Content[j].title;<br />						desList[k] = obj.result.items[indexOfItems].Content[j].description;<br /><br />						idList[k] = obj.result.items[indexOfItems].Content[j].id;<br /><br />						k++;<br />					}<br />				}<br /><br />			}<br /><br />		}<br /><br />		xmlHttp<br />				.open(<br />						"GET",<br />						"",<br />						false);<br />		xmlHttp.setRequestHeader("key", obj4.result.key, false);<br />		xmlHttp.setRequestHeader("client_type", "2", false);<br />		xmlHttp.send(null);

before i get urllist json data i use urllist in kind of scrolImageList i used urlList[i] but it returns me undefined:
setupItem : function(sender, ev) {<br /><br />		var imageUrl = '='<br />				+ urlList[1];<br /><br />		Id++;<br />		ev.item.$.image.setSrc({<br />			'hd' : utils.format(imageUrl, '132x132'),<br />			'fhd' : utils.format(imageUrl, '198x198')<br />		});<br />		ev.item.$.title.content = titleList[1];<br />		ev.item.$.des.content = desList[1];<br />		i++;<br /><br />	}, 
and if you have any other suggestion for request i would appreciate.

Comments

Sign In or Register to comment.