how to fetch data from json in javascript.....
how to fetch data from json in javascript.....
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Ravi KumarPosted Mar 9, 2015, 4:51 AM
$('#Fk_ProductSubGroupId').combobox({
select: function () {
//alert(this.value);
// event.preventDefault();
// var value;
$('#Fk_ProductId').empty();
$.ajax({
url: '/Invoice/GetProducts',
type: 'POST',
dataType: 'json',
data: { id: this.value },
success: function (data) {
var i = 0;
while (data[i]) {
var option = $("");
$("#Fk_ProductId").append(option);
i++;
}
$('#Fk_ProductId').next().find('input').focus();
},
error: function () {
alert('error');
}
});
}
});
Prasham SabadraPosted Mar 9, 2015, 4:14 AM
Please have a look at following links once:
https://www.dartlang.org/docs/tutorials/fetchdata/
http://api.jquery.com/jquery.getjson/