Like we store XML in an XML file, can we store JSON data in a separate file
and query it from a an html page ? How can the JSON data be stored instead of adding that data to the tags and querying it ?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Javeed M ShaikhPosted Nov 9, 2011, 8:04 AM
JSON is just a way of representation the data, its upto you how/where you store it, may be like this in a aa.js file:
{
"id": 1
"name" : "Vipul"
}
and then you can try to retrieve it like this..
$(document).ready(function(){
$.getJSON("http://pathtotheJsonData/aa.js?callback=?",
function(data){
alert(data.name);
});
});