How to fetch data from json in javascript.....
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Prasham SabadraRank #116 · 19.3K reputationPosted Mar 9, 2015, 12:14 AM EDT
Please have a look at following links once:
https://www.dartlang.org/docs/tutorials/fetchdata/
http://api.jquery.com/jquery.getjson/
Ravi KumarRank #2,085 · 690 reputationPosted Mar 9, 2015, 12:51 AM EDT
$('#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');
}
});
}
});