Getting "not well-formed" in FF error when reading JSON from a local file

时间:2016-02-12 21:45:01

标签: javascript jquery json mime-types

I'm working on a project on my computer and I'm getting "not well-formed" error when trying to read a json object from a file located on my machine.

It happens on Firefox. In Chrome, I'm getting "XMLHttpRequest cannot load file...".

I've tried changing the Mime-type to application/json but in vain.

Could you please help?


My code :

if cv2.waitKey(0) & 0xFF == ord('q'):
    break

1 个答案:

答案 0 :(得分:0)

if this is a local file, you should be using $.getJSON It is still asynchronous.

"1, 2, 3, 4, 5"