I have the following AJAX call and right now I have the description
, name
and id
of the company in the dropdown menu.
I am wondering if I can hide something like data.company[i].id
. This will be hidden from the UI but I still want it because when a user selects a project, I am grabbing the id in my other logic.
$.ajax({
url: 'myurl',
type: 'GET',
dataType: 'json',
success: function(data) {
$.each(data.company, function(i) {
$("#mylist").append('<option>' + data.company[i].description + ' | ' + data.company[i].name + ' | ' + data.company[i].id + '</option>');
});
},
error: function(request, error) {
$.growl.error({
title: "Error",
message: "Webservice request failed!"
});
}
});