Ver Mensaje Individual
  #4 (permalink)  
Antiguo 12/11/2013, 20:41
Avatar de Panino5001
Panino5001
Me alejo de Omelas
 
Fecha de Ingreso: mayo-2004
Ubicación: -34.637167,-58.462984
Mensajes: 5.148
Antigüedad: 20 años
Puntos: 834
Respuesta: Enviar un objeto por ajax?

Edito: es tal como lo mencionás en el post anterior (yo escribí este mientras vos lo modificabas)


Algo así:
Código PHP:
<?php 
if(isset($_POST['pp'])){
    echo 
'<pre>';
    
print_r(json_decode($_POST['pp'],true));
    echo 
'</pre>';
    exit;
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<script>
onload=function(){
    var arreglo=[];
    arreglo[0] = "Información aquí";
    arreglo[1]= "Información aquí también";
    arreglo[2]= "Y aquí";
    arreglo[3]= "Información aquí";
    document.getElementById('pp').value=JSON.stringify(arreglo);
}
</script>
</head>

<body>
<form method="post" action="<?php echo $_SERVER['PHP_SELF'?>">
<input name="" type="submit" value="Probar" />
<input type="hidden" name="pp" id="pp">
</form>
</body>
</html>