Am new to jquery.I need to know how to pass external json
file as a argument to a function.
I know how to pass as a object
in client side like below.
var json = { "key": "value" }
Basically i need to call this below function by passing the json data
.
function draw(json) {
// Code here
console.log(json);
}
In client side json
means i know to how to pass.
draw(json);
But my json file is come from server(External Json File)
I tried jquery.getJson()
method also.But not getting exact solution.I don't know what i did mistake also.
My $.getJson
code
draw("$.getJSON("http://localhost/cb/json/Json_30647.json",function(data) {
return data;
}));
Please help me to solve this issue.Thanks in advance.