given select1 and select2 like this:
then you can do something like this with jQuery:
$('#select1').on('change', function() {
$.ajax({
url: "test.html",
}).done(function(response) {
$('#select2').html(response);
});
This assumes your ajax call returns a string like
from your server sided file. If you return a json you have to decode it first, but this is the general gist of it. Take a look at the jQuery ajax() function