David Newton wrote:If you were using a modern JavaScript framework this would be even easier.
Indeed, if the server-side resource were to just create the HTML fragment containing the options, the client-side code, using jQuery, would be as simple as:
Without jQuery, you'll need to do the Ajax "by hand" (not recommended) and use innerHTML to inject the options.