I am trying to get this ajax call to work:
<script type="text/javascript">
$( document ).ready(function() {
$('#home_location').change(function(){
$.ajax({
url: 'GetCommunities.php',
data: {id: $(this).val()},
datatype: 'json',
success: function(data){
console.log(data);
}
});
});
});
</script>
The console log returns my data like so:
[{"rb_communityId":"8","rb_communityLabel":"Sunflower","rb_communityOrder":"12","rb_locationId":"4"}]
my question is how do I make the rb_communitiyId into an array and use that array to for select options to replace a current dropdown?