
14/06/2012, 04:21
|
 | | | Fecha de Ingreso: junio-2012
Mensajes: 536
Antigüedad: 12 años, 8 meses Puntos: 127 | |
Respuesta: Variables de sesion Cita:
Iniciado por Gothgauss que podría ser problema de la variable es lo priemr que pensé, así que sustituí ese valor por algo estático, pero sigue sin ir.
$.ajax({
* * * * * * * * type:'GET',
* * * * * * * * url:'sesion.php',
* * * * * * * * data:{'producto':'macarrones'},
* * * * * * * * * * * * * * * * success: function(data){
*blablabla Aquí tienes una plantilla, para evitar pequeños errores que pasen desapercibidos por todos: Cita: $.ajax({
url: '/path/to/file',
type: 'GET',
data: {param1: 'value1'},
complete: function(xhr, textStatus) {
//called when complete
},
success: function(data, textStatus, xhr) {
//called when successful
},
error: function(xhr, textStatus, errorThrown) {
//called when there is an error
}
}); Por tanto
Código Javascript :
Ver original$.ajax({ url: 'sesion.php', type: 'GET', data: {"producto": 'productocualquiera'}, success: function(data, textStatus, xhr) { data = $.parseJSON(data); alert("primer valor del array: "+data[0]); }, error: function(xhr, textStatus, errorThrown) { alert("Ha habido un error con la petición"); } });
|