javascript - Why doesn't Safari decodeURIcomponent() a URI-ecoded piece of JSON automatically, like Firefox? -
i'm passing uri-encoded json string secure iframe non-secure grandparent iframe. when reaches parent, parse using yui's
yahoo.lang.json.parse()
in firefox, works perfectly, , string looks
"{\"cntctnm\":\"mike\",
in safari, looks
"{%22cntctnm%22:%22mike%22,
and
yahoo.lang.json.parse()
chokes.
so, how viable hackaround of looking uri encoding, , decoding string if find it?
if(jsonstr){ secrjsonresp.indexof("22:%22")>-1; var updtjsonobj = cmn.parsejson(decodeuricomponent(jsonstr)); }else{ var updtjsonobj = cmn.parsejson(jsonstr); };
Comments
Post a Comment