How to store json file to javascript infovis toolkit variable?

75 views
Skip to first unread message

Sudhakar sekar

unread,
Apr 8, 2017, 2:52:16 AM4/8/17
to JavaScript InfoVis Toolkit
Hello All,
How to store the json file to javascript?
How to load the json file using loadJSON keyword?
Please help me about this.. I am struggling these one in more than 2 days...
                     Thank you.......

Photon

unread,
Sep 27, 2018, 7:35:18 AM9/27/18
to JavaScript InfoVis Toolkit
The reply comes rather late but a dirty hack would be to make the file YOURJSONFILE.js have the form

jsonVar = {YOUR JSON DATA}

include the file as a JS script in your HTML file:

<script language="javascript" type="text/javascript" src="YOURJSONFILE.js"></script>

and then load the variable with

loadJSON(jsonVar)
Reply all
Reply to author
Forward
0 new messages