PDA

View Full Version : Ext.decode has differing behavior on android



fx-mike
18 Jul 2011, 7:18 AM
Hi

I have found that Ext.decode (i.e. JSON.parse) has different behavior on android when decoding an int.


Ext.decode(23)

- returns 23 on safari/mobile safari/android virtual device (2.2)
- fails on android (HTC desire with 2.2) because of illegal argument

This is how i fixed it:


Ext.decode = function(s) {
if(Ext.isNumber(s)){
return s;
}
return JSON.parse(s);
};


Any thoughts?

Cheers
Mike