120
rated 0 times
[
127]
[
7]
/ answers: 1 / hits: 8804
/ 11 Years ago, tue, december 17, 2013, 12:00:00
this is my code snippet
jQuery('select[name=' + element + ']').html('<option value=>Select</option>');
jQuery.each(data, function(key, value) {
jQuery('select[name=' + element + ']')
.append(jQuery(<option></option>)
.attr(value, key)
.text(value));
});
and this is the array that i am getting from response
{1:470 - MAJOR JOINT REPLACEMENT OR REATTACHMENT OF LOWER EXTREMITY W/O MCC,2:885 - PSYCHOSES,3:897 - ALCOHOL/DRUG ABUSE OR DEPENDENCE W/O REHABILITATION THERAPY W/O MCC,4:885 - PSYCHOSES,5:470 - MAJOR JOINT REPLACEMENT OR REATTACHMENT OF LOWER EXTREMITY W/O MCC}
and i am getting this error, i dont know why i am getting this error TypeError: invalid 'in' operand obj
EDIT : TO remove confusion i am posting the function with which i am sending request as follows:
function fetchValuesForDrgDefinition(url,drg) {
jQuery.ajax({
type: json,
url: url,
}).success(function(data) {
appendOptionsInSelectBox(drg,data);
});
}
More From » jquery