2 pytania:
Dlaczego nie działa pod IE
Dlaczego po klikniecie na link obniża wyświetlane dane o jeden enter
oto kod:
Kod:
function $(id) { return document.getElementById(id); } function parseRecords(xml) { record = xml.getElementsByTagName("record"); result = ""; with (xml.getElementsByTagName("records").item(0)) { $("d").innerHTML = ""; } for ( j=0; j<record.length; j++ ) { tr = document.createElement("tr"); for ( i=0; i<record[j].childNodes.length; i++ ) { if(record[j].childNodes[i].hasChildNodes()) { td = document.createElement("td"); td.innerHTML = record[j].childNodes[i].childNodes[0].nodeValue; tr.appendChild(td); } } d.appendChild(tr); } return result; } function getRecords(t) { advAJAX.get({ url : "test.php", parameters:{ t: t, }, onInitialization : function() { $("d").innerHTML = 'Pobieranie danych...'; }, onSuccess : function(obj) { parseRecords(obj.responseXML); } }); }
Kod:
<html> <head> <meta http-equiv="Content-Language" content="pl"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1250"> <meta name="GENERATOR" content="Microsoft FrontPage 4.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> </head> <body> <table border="0" cellpadding="0" cellspacing="0" width="100%" height="1"> <tr> <td width="36%" valign="top" height="1"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td width="100%"> </td> </tr> </table> </td> <td width="36%" valign="top" height="1"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td width="100%"> <table cellpadding="1" cellspacing="1"> <tbody id="d"> </tbody> </table> </td> </tr> </table> </td> </tr> </table>
Kod:
<? include "config.inc.php"; $query="SELECT * FROM towar2 WHERE id_towaru2='$t'"; $i=1; } ?>
i link do dzialajacego skryptu pod firexoks
http://sport.nazwa.pl/ajax/