Prototype callbacks: return a value

ljundie
Mon, 30 Jun 2008 08:51:34 -0000

hello back, another funny question with prototype callbacks :)


i dont manage to get a callback return a value. the example would be:





var lucas = 0;

function loadRSS() {
         var url = "sample_feeds/sample_feeds_TTblog.xhtml";
         var myAjax = new Ajax.Request( url, {
										method: ''get'',
										parameters: '''',
										onComplete: lucas = processRSS
										});
         }

 function processRSS(xmlHttpRequest, responseHeader) {
		value = 1;
		return value;
 }


if (lucas==1) {
	alert (''ole!'');
	}







i''ve also tried, without any result, something like:
onComplete: function (xmlHttpRequest, responseHeader) {
lucas = processRSS(xmlHttpRequest, responseHeader);
			}



every little help worths :)