bfunc({
"query": {
"count": 1,
"created": "2013-05-03T06:20:01Z",
"lang": "en-US",
"diagnostics": {
"publiclyCallable": "true",
"cache": {
"execution-start-time": "32",
"execution-stop-time": "32",
"execution-time": "0",
"method": "GET",
"type": "MEMCACHED",
"content": "http://www.vtualerts.com/robots.txt"
});
This is my JSON data which i need to parse using javascript and jquey. I tried to do it like this......
<div id="placeholder"></div>
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script>
$.getJSON('myjson.json', function(data) {
var output= data.cbfunc.query.count+ "" + data.cbfunc.query.created;
document.getElementById("placeholder").innerHTML=output;
});
but i am getting the error
"XMLHttpRequest cannot load file:///home/shivratna/Desktop/myjson.json. Origin null is not allowed by Access-Control-Allow-Origin."
Please help.
Sincere thanx.
bfunc(...)
is not valid JSON. It's not even valid JSONP. – Jan Dvorak May 3 at 7:05