I have to use jquery serialize for this var... how to?
var type = { op:"add" , id_user : <?=$u->id?> , tipo : tipo , description : $("#desc_new_param").val() }
$.ajax({type: "POST",cache: false,url: "<?=SYSTEM_WEB_ADMIN?>second.php",data: type,success: function(data) {
$("#tab-"+tipo).html(data);
}});
I assume by serialize you mean convert between string and object. Use the JSON object methods:
var type = {
op:"add" ,
id_user : 1431 ,
tipo : "tipo something" ,
description : "some sort of description"
};
var myTypeString = JSON.stringify(type);
console.log("myTypeString is a "+typeof(myTypeString), myTypeString);
console.log("As a JSON object: ", JSON.parse(myTypeString) );
</div>