我正在开发一个项目,但我不知道如何做到这一点。我有一个 json 文件,需要将其分配给 js 变量才能使用 protovis 可视化工具。
我尝试在谷歌上搜索,但找不到任何结果。如果有人知道如何做到这一点,请告诉我。谢谢!
最佳答案
Description: Takes a well-formed JSON string and returns the resulting JavaScript object. version added: 1.4.1jQuery.parseJSON( json ) jsonThe JSON string to parse. Passing in a malformed JSON string may result in an exception being thrown.
关于javascript - 将存储在文件中的 json 分配给 js 变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8538952/