How can we read the JSON file in a Folder using jQuery in ASP.NET?

Posted by Hemanthlaxmi under jQuery on 7/23/2012 | Points: 10 | Views : 2372 | Status : [Member] | Replies : 2
Hi All,


Can any one help me about How to read the JSON file in a Folder using jQuery?

I have tried like this but always my cursor going to the Failure Method.

var urlJSON = '<%=ResolveUrl("example.json") %>';
$(document).ready(function () {
$('#btnLoad').click(function () {
$.ajax({
url: urlJSON,
dataType: "json",
type: "POST",
contentType: "application/json;charset=utf-8",
success: AjaxSucceeded,
error: AjaxFailed
});
});
});

function AjaxSucceeded(result) {
alert(result.d);
}
function AjaxFailed(result) {
alert(result.status + ' ' + result.statusText);
}

If this helps you .
Please "Mark as Answer"



Responses

Posted by: Ranjeet_8 on: 7/23/2012 [Member] [MVP] Gold | Points: 25
Posted by: Hemanthlaxmi on: 7/23/2012 [Member] Starter | Points: 25

Up
0
Down
Myself posted the same Thread there also.

If this helps you .
Please "Mark as Answer"

Hemanthlaxmi, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response