I have a JSON structure which looks like this
[
{
"term_id":"28",
"name":"Audi",
"slug":"audi",
"term_group":"0"
}
]
In my HTML page, I have a dropdown button where I want to show the name after the click. To do this I have some Javascript code which looks like this:
var serviceURL = "http://www.dohamark.com/samudra/";
var make;
$('#make1').bind('pageinit', function(event) {
getEmployeeList();
});
function getEmployeeList() {
$.getJSON(serviceURL + '1st.php', function(data) {
$.each(data, function(index, employee) {
$('#make1').append('<option>' + employee.name + '</option>');
});
});
}
However, this script shows nothing in the dropdown button click but a blank place. I am very new in JavaScript and don't know much about JSON parsing. Could somebody help identify my mistake?