-
simple login form with Ext.JSON.decode
simple login form with Ext.JSON.decode
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 ? :-)
-
Sencha - Senior Forum Manager
Have you inspected what the result param is? I would have expected an error decoding a string.
-
i changed it to
if (result == 'success') {
and that seems to be working :-)
Sencha is used by over two million developers. Join the community, wherever you’d like that community to be
or Join Us