0
How do I make a select in the database using only a jQuery? I have two combobox and want to use their value to make a select in my database:
$.getJSON('/MinhaDoenca/rest/hospital/get', function(data) {
for ( var index in data) {
$("#idHospital").append(
'<option value="'+data[index].nome+'">'
+ data[index].nome + '</option>')
}
});
$.getJSON('/MinhaDoenca/rest/especialidade/get', function(data) {
for ( var index in data) {
$("#idEspecialidade").append(
'<option value="'+data[index].descricao+'">'
+ data[index].descricao + '</option>')
}
});
I would like to take these two values and make a query in my database, but using only jQuery and HTML, without PHP. Is it possible? Could someone give me an example? (my database is Postegresql)
Even consuming a Web Service?
– emanuel cavalcante
When I said API I refer to this API Rest, Soap etc, which are ways to be developing Web Service’s.
– Yure Pereira
That also using a Web Service would not run away from a server-side programming link like PHP.
– Yure Pereira