I'm using Salesforce Ampscript code with jQuery to access a table in a DB to populate. which wasn't working. I've stripped out the Ampscript code to just have a simple jQuery function and funtion call with a static table and I can see that my problem is that my jQuery syntac is wrong.
I striped it down to just the select tags, the function and a static function call. If I can get this working then I can re insert the ampscript variables
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script>
var fillDataList = function( options )
{
var items = ''
$.each( options, function ( index, option ) {
items += '<option value="' + option + '">'
items += option
items += '</option>' })
return items
}
</script>
<table> <tr><th>Test 4</th></tr>
<tr>
<td>
<script>
var obj = { one: 'hey 1', two: 'hey 2', three: 'hey 3', four: 'hey 4', five: 'hey 5'};
$('#test').append(fillDataList(obj));
</script>
</td>
</tr>
<tr>
<td> <select id="test">
</select> </td>
</tr>
</table>