I am new to web and I need to get JSON object for a webpage that has data displayed this:
{
"expires": "2011-09-24T01:00:00",
"currencies": {
"BZD": {
"a": "2.02200",
"b": "1.94826"
},
"YER": {
"a": "220.050",
"b": "212.950"
}
}
I tried use jquery's $.getJSON to get the object but it didn't work.
<script>
$.getJSON("http://m.somewebsite.com/data",
{
format: "json"
},
function(data) {
document.getElementById('test').innerHTML = data;
});
</script>
I am wondering how to get this information correctly?
document.write()there, you will replace the current contents of the page.