BarryOg
7 Jul 2007, 2:39 PM
I have the following function for making ajax request against my php data layer:
function sendCall(dataToSend, domDump){
var retString;
var con = new Ext.data.Connection();
con.request({
url: 'http://www.liamolony.com/game/jsonInterface.php5',
params: {data: Ext.util.JSON.encode(dataToSend)},
method: 'post',
callback: function(opts,suss,resp) {
if(resp.responseText != ''){
alert(Ext.util.JSON.decode(resp.responseText));
if(domDump != ''){
Ext.get(domDump).dom.innerHTML = Ext.util.JSON.decode(resp.responseText);
}
}
}
}
);
return retString;
}
Is there a way to get resp.responseText out of the callback function without using a div in between? Or if its impossible how do I ensure that the div contents doesn't get shown?
function sendCall(dataToSend, domDump){
var retString;
var con = new Ext.data.Connection();
con.request({
url: 'http://www.liamolony.com/game/jsonInterface.php5',
params: {data: Ext.util.JSON.encode(dataToSend)},
method: 'post',
callback: function(opts,suss,resp) {
if(resp.responseText != ''){
alert(Ext.util.JSON.decode(resp.responseText));
if(domDump != ''){
Ext.get(domDump).dom.innerHTML = Ext.util.JSON.decode(resp.responseText);
}
}
}
}
);
return retString;
}
Is there a way to get resp.responseText out of the callback function without using a div in between? Or if its impossible how do I ensure that the div contents doesn't get shown?