You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fahimc edited this page Mar 21, 2013
·
3 revisions
About
This tutorial will explain how to load a JSON file and then convert the data string into a JSON object.
Load A JSON File
// Use Utensil's URLLoader to load the json fileUtensil.URLLoader.load('example.json',onDataLoadComplete);},// this function will take two parameters which will be set by Utensil's URLLoader. First is the raw text //string and the second is XML (if applicable).
onDataLoadComplete:function(t,x){}
Converting the Data String to an JSON Object
onDataLoadComplete:function(t,x){// use the eval method to turn the data string into a JSON Objectvarjson=eval('('+t+')')}