Salve a tutti!
Premetto che non sono una cima - con il jquery, intendo! - ma piano piano sto cercando di imparare.
Premesso ciò, ho un discorso del genere:
codice:
$(document).ready(function() {
$(".cat").click(function(){
id = $(this).attr('id');
comp_id = "id=" + id;
$.ajax({
type: "GET",
url: "../content/listinopap_exe.php",
data: comp_id,
success: function(response){
$("#tipo_pap").html(response);
}
});
});
});
che funziona alla grande! Ma appena modifico così:
codice:
$(document).ready(function() {
$(".cat").click(function(){
id = $(this).attr('id');
comp_id = "id=" + id;
$.ajax({
type: "GET",
url: "../content/listinopap_exe.php",
data: comp_id,
success: function(response){
$("#tipo_pap").html(response);
}
});
});
$(".tipopap").click(function(){
id = $(this).attr('id');
comp_id = "id=" + id;
$.ajax({
type: "GET",
url: "../content/prodotti_exe.php",
data: comp_id,
success: function(response){
$("#prodotti").html(response);
}
});
});
});
La seconda funzione non vuole saperne di andare.
Dove sbaglio?