DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
getJSON on Drop Down Change Event
function populateDropDown() {
$.getJSON('/getData.aspx', { Name:$('#parm').val()}, function(data) {
var select = $('#DDLControl');
var options = select.attr('options');
$('option', select).remove();
$.each(data, function(index, array) {
options[options.length] = new Option(array['variety']);
});
});
}
$(document).ready(function() {
populateDropDown();
$('#DDLchangeData').change(function() {
populateDropDown();
});
});
Simple jQuery getJSON request with call back to load drop down list control.




