i have created a AJAX request , where i have sent data to process.php page , this page will process this data and then will create a JSON object that will be sent as AJAX response. Now i need to create one second JSON object in order to sent as AJAX response, that is possible? , if is possible , how i can to manage this two objects separatelly?
The code that i have is:
$(document).on('change', '#seleccio_test,#seleccio_test2', function(){
var capaTEST;
var pagina="show_test_prova.php";
$.ajax({
async:false,
cache:false,
dataType:"json",
type: "POST",
url: pagina,
data: "dades_test="+obtenirTest(),
success: function(obj1){
//alert(JSON.stringify(resultat));
var idtest=0;
$.each(obj1, function(key, value) {//object 1 that i retrieve from process.php
if(key !=0){
for (i = 0; i < value.length; i++) {
alert("Key:" + key + " /value: " + value+" /index: "+idtest);
var llistat_test="";
llistat_test +="<div id='"+value+"'>";
llistat_test+="<ol><li><label for='test' id='etiquetalabel'>"+value[i]+"</label>";
llistat_test+="<input type='checkbox' id='$capaCONTENT"+idtest+"name='test[]' value='"+value[i]+"'";
llista_test+="onclick=' onclick='show_content($seleccio_content,$id_capa,$pagina,$idtest,$valor_org,$valor_eval,$valor_test)';>";
llistat_test+="</div> <ol> <div style='display: none;'> </div></ol></li></ol> ";
var contenido= $("#"+key);
var elementBuscado=$("#"+value);
//if(!contenido.find(elementBuscado).length){
//no exist
contenido.append(llistat_test);
//}
idtest++;
}
}
});
},
beforeSend:function(){},
error:function(jqXHR, textStatus, errorThrown ){}
})
})
Regards.