Hi Marc,
I'm not sure why sometimes the returned data is not considered to be an
object. It might be because, in the case of long strings, we are not
respecting JSON in some manner. In this case, you can use logic similar
to the one in sql.js where we use typeof
if (typeof data.success != 'undefined') {
...
} else {
...
}
P.S. are you using Firebug? it's an invaluable tool to debug these kind
of things.