“not well-formed” error in Firefox when loading JSON file with XMLHttpRequest

前端 未结 8 2175
青春惊慌失措
青春惊慌失措 2020-11-28 09:57

I\'m getting a \"not well-formed\" error in the error console of Firefox 3.0.7 when the JavaScript on my page loads a text file containing an object in JavaScript Object Not

相关标签:
8条回答
  • 2020-11-28 10:26

    I found the same error message but from a very different cause. After a little time fruitlessly changing the JSON content, realized that I had accidentally restarted the page running off the local file system (file://Users/me/Sites/mypage.html) rather than the server (http://localhost/~me/Sites/mypage.html).

    0 讨论(0)
  • 2020-11-28 10:27

    It should be {"a": 3} actually.

    0 讨论(0)
提交回复
热议问题