[英]JSON.parse fails in Google Chrome
var origtext = Aes.Ctr.decrypt(recentPatientsFile.read().text, 'L0ck it up saf3', 256);
var recentPatientsList = JSON.parse(origtext);
在做alert(origtext)
,我得到空數據。 JSON.parse(空數據)在其他瀏覽器中工作正常,但在谷歌瀏覽器中我得到Uncaught SyntaxError: Unexpected end of input
。 當我刪除JSON.parse(),然后一切似乎都沒問題。
就這樣逃避吧
var value = JSON.parse(origtext || "null");
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.