Friday, 15 February 2013

javascript - Can I save json data in a .js page instead of a .json file -



javascript - Can I save json data in a .js page instead of a .json file -

we building static app of sorts user can publish static pages our site, download them , install them on own web server. in order relying on json info stored in json files. concern have no way of controlling servers , unclear if servers back upwards .json file mime/types.

can save json info in .js file, instead avoid potential problem?

sure. save variable in js.

var myjsondata = { "thing": true, "otherthing:" 4 "fancyarray":[ "hello", "hi", "greetings" ] };

javascript json

No comments:

Post a Comment