Código Javascript:
Ver original
<!-- function ini() { tab=document.getElementById('tabl'); for (i=0; ele=tab.getElementsByTagName('td')[i]; i++) { ele.onmouseover = function() {iluminar(this,true)} ele.onmouseout = function() {iluminar(this,false)} } } function iluminar(obj,valor) { fila = obj.parentNode; for (i=0; ele = fila.getElementsByTagName('td')[i]; i++) ele.style.background = (valor) ? '#B9F8F8' : ''; } --> function filtrar() { $.ajax({ data: $("#frm_filtro").serialize()+ordenar, type: "POST", dataType: "json", url: "ajax.php?action=listar", beforeSend:function(){ $('.carga1').css('display','block'); $('.carga1').html("<img src='imagenes_menu/ajax-loader4.gif' align='center' /><br />Cargando..."); }, complete: function() { $(".carga1").show(); $(".carga1").hide(); }, success: function(data){ var html_user ='' ; if(data.length > 0){ $.each(data, function(i,item){ html_user += ' <body>'; html_user += '<form action="prod_sppb.php" method="post" name="nombreform">'; html_user += '<table id="tabl">'; html_user += '<tr bgcolor=#DFEBFF onMouseOver="ini()" ondblclick="pulsar(this, '+ String.fromCharCode(39) + item.id_aviso +String.fromCharCode(39) + ');" >'; html_user += '<td style="'+item.style+'"><input name="demo" type="checkbox" value="' + item.id_aviso + '"/></td>'; html_user += '<td style="'+item.style+'">'+item.id_aviso+'</td>'; html_user += '<td style="'+item.style+'">'+item.telefonos+'</td>'; html_user += '<td style="'+item.style+'">'+item.name+' '+item.apellidos+'</td>'; html_user += '<td style="'+item.style+'">'+item.calle+'</td>'; html_user += '<td style="'+item.style+'">'+item.localidad+'</td>'; html_user += '<td style="'+item.style+'">'+item.aparatos+'</td>'; html_user += '<td style="'+item.style+'">'+item.marcas+'</td>'; html_user += '</tr>'; html_user += '</table>'; html_user += '</form>'; html_user += '</body>';
El error que me da:
Código HTML:
Ver original
TypeError: tab is null for (i=0; ele=tab.getElementsByTagName('td')[i]; i++) {
Gracias y feliz año.

Bueno pero entonces como rayos estas haciendo el sitio web? acaso no estás usando CSS para el diseño? si es un ejercicio tendría todo el sentido del mundo que no sepas...
).


