I'm sorry. I have posted in many js groups, but no answer...
I have a js object, and I need to return de data handled by the ajax
request...see on the green comment
dojo.declare("util", null, {
evalOnBlur: function(id) {
eval(dojo.byId(id).attributes['onBlur'].value);
},
getNomeComponente: function(expr) {
return expr.substring(3, 11).toUpperCase();
},
getValor: function(expr) {
var retorno = null;
var bindArgs = {
url: 'execexit',
content : { method : 'execsql',
sql : 'select 10 as coisa from
pocaauxi'
},
mimetype: "text/json",
error: function(type, errObj){
alert("Erro ao fazer request, tente novamente em
"
+ "alguns minutos. " + errObj);
retorno = 'erro';
alert(retorno);
},
load: function(type, data, evt){
retorno = data.colunas;
alert(retorno);
//I tried return here too
}
};
var requestObj = dojo.io.bind(bindArgs);
requestObj.load();
alert(retorno);
return retorno; //return always nulll :(
}
});
This is a class to handle the ajax requests, i need to call this function in
other part of code, and get only the number value returned.
Thanks all.