我正在試圖在Google's dictionary semi-api中查找單詞「flower」。來源:爲什麼JSON.parse會阻塞nodejs中的編碼字符?
https://gist.github.com/DelvarWorld/0a83a42abbc1297a6687
長話短說,我打電話與JSONP回調paramater然後regexing出來。
但它擊中這個障礙:
undefined:1
ple","terms":[{"type":"text","text":"I stopped to buy Bridget some \x3cem\x3ef
^
SyntaxError: Unexpected token x
at Object.parse (native)
谷歌的服務我逃出來的HTML字符,這是很好的,但JSON.parse
無法處理他們?什麼是weirding我出來就是這個工作得很好:
$ node
> JSON.parse('{"a":"\x3cem"}')
{ a: '<em' }
我不知道爲什麼我的thingle崩潰
編輯這些都是很好的信息repsonses,但沒有人幫我擺脫堆棧跟蹤。
看看http://json.org/ – Paul