I am looking to populate a combo box with a Json file that is representing the file contents of a folder in a directory. I have snippets of code but its obviously not working and I am unsure how to go about implementing it correctly.
My Json code i want to populate the combo box looks like this:
["xml/cdcatalog.xml","xml/equip.xml"]
And this is the script i have embedded into the HTML page:
$(document).ready(function() {
$("#list1").jCombo(function() {
$.getJSON('Jsontest.php?q=' + escape($('#list1').val()), function(data) {
if ($("#list1").val() > 0) {
alert("You chose " + $("#list1").val());
}
});
});
});