यह कैसे आ काम नहीं करता है (एक खाली चयन सूची <select id="requestTypes"></select>
jQuery जेएसओएन से चयन सूची विकल्प बनाते हैं, विज्ञापन के रूप में नहीं हो रहा है?
$(function() {
$.getJSON("/RequestX/GetRequestTypes/", showRequestTypes);
}
);
function showRequestTypes(data, textStatus) {
$.each(data,
function() {
var option = new Option(this.RequestTypeName, this.RequestTypeID);
// Use Jquery to get select list element
var dropdownList = $("#requestTypes");
if ($.browser.msie) {
dropdownList.add(option);
}
else {
dropdownList.add(option, null);
}
}
);
}
पर काम लेकिन यह करता है:
बदलें:
var dropdownList = $("#requestTypes");
- सादे पुराने के साथ
जावास्क्रिप्ट:
var dropdownList = document.getElementById("requestTypes");
धन्यवाद! आप और जिम दोनों बहुत उपयोगी थे! – Codewerks