I am working on get json from server in javascript.
i used pure javascript, jquery but i am getting status 0.
$(document).ready(function() {
$("#btn").click(function(event){
$.getJSON('http://myhost/myapp/data.json', function(jd) {
alert(jd);
});
});
});
<body>
<input type="button" id="btn" value="Load Data" />
</body>
getJSON()
block not called.
can anyone help me?