Código Javascript:
Ver original
$("#editForm").submit(function(){ //Getting action and method from form var that = $(this), url = that.attr('action'), type = that.attr('method'), data = {}; //Getting values from form that.find('[name]').each(function(index,value){ var that = $(this), name = that.attr('name'), value = that.val(); data[name] = value }); //Playing with ajax $.ajax({ type: type, dataType: 'json', url: url, data: data, // Showing a message with php success: function(data){ console.log(data.msg); if(data.success == 0){ $("#result").html("<div class='alert alert-danger fade in'><a href='#' class='close' data-dismiss='alert' aria-label='close'>×</a><span id='message'>"+data.msg+"</span></div>"); } else if(data.success == 1){ $("#result").html("<div class='alert alert-success fade in'><a href='#' class='close' data-dismiss='alert' aria-label='close'>×</a><span id='message'>"+data.msg+"</span></div>"); } } }) return false; })
cuando veo por consola lo que esta enviando me aparece "array()", ese mismo script lo uso en otro archivo para insertar informacion y funcinoa a la perfeccion..