Platinum Partner

getJSON on Drop Down Change Event

Simple jQuery getJSON request with call back to load drop down list control.

 

 

	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();
	    });
	     
 	});
{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks
Tweet

{{parent.nComments}}