jakobo
7 May 2012, 12:29 AM
i am trying to create a simple login function towards a php script where i JSON encode a string
PHP code:
$jsonString = json_encode('success');
echo $jsonString;
the i use Ext.JSON.decode to parse the result like this in my logincontroller:
var result = Ext.JSON.decode(response.responseText);
if (result.success) {
Ext.Msg.alert(working);
}
else{
Ext.Msg.alert(result);
}
and i get a Ext.Msg.alert saying success ;-)
anyone that can tell me what i am doing wrong here ? :-)
PHP code:
$jsonString = json_encode('success');
echo $jsonString;
the i use Ext.JSON.decode to parse the result like this in my logincontroller:
var result = Ext.JSON.decode(response.responseText);
if (result.success) {
Ext.Msg.alert(working);
}
else{
Ext.Msg.alert(result);
}
and i get a Ext.Msg.alert saying success ;-)
anyone that can tell me what i am doing wrong here ? :-)