Ver Mensaje Individual
  #6 (permalink)  
Antiguo 04/01/2011, 10:26
jesusjj
 
Fecha de Ingreso: noviembre-2007
Mensajes: 154
Antigüedad: 16 años, 5 meses
Puntos: 2
Respuesta: jQuery $.ajax y PHP con un CSV

Buenas,

tras hacer unos cambios me devuelve el siguiente error en FireBug:

XML filter is applied to non-XML value (function (a, b) {return new (c.fn.init)(a, b);})
[Interrumpir en este error] $.('#' + popID).html(data);


Los cambios han sido:
Código PHP:
if(isset($_POST['pag']) && ($_POST['pag'] == 'products') && isset($_POST['clave'])) {
    
$clave $_POST['clave'];
    
    echo 
json_encode(productsCatalog($clave'products'));
    
}

########

function productsCatalog($clave$fichero) {
    
    
$fileCSV RUTA_CSV.$fichero.'.csv';
   
    
$data = Array();
    
    
$data fgetcsv($fileCSV1000";") or die ("Error al abrir fichero CSV");
      
    return 
$data;



Y en JS:
Código Javascript:
Ver original
  1. $.post('index.php', {pag:'products', clave: popID},
  2.             function(data) {            
  3.                 $.('#' + popID).html(data);            
  4.         });