Jump to content

melsi

Members
  • Posts

    4
  • Joined

  • Last visited

melsi's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. im now achieving this - http://www.betjeeves.com/test using this: <script type="text/javascript">if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); }else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }xmlhttp.open("GET","test.xml",false);xmlhttp.send();xmlDoc=xmlhttp.responseXML;document.write("<table border='1'>");var x=xmlDoc.getElementsByTagName("match");for (i=0;i<x.length;i++) { document.write("<tr><td>"); document.write(x[i].getElementsByTagName("bet")[0].getAttribute("name")); document.write("</td><td>"); document.write(x[i].getElementsByTagName("choice")[0].getAttribute("odd")); document.write("</td></tr>"); }document.write("</table>");</script> How can i add an extra column to the table with the team names? thanks
  2. Ok thanks, excuse my ignorance but would you mind explaining in a little more detail how i would do that?
  3. thanks for you response! I tried that but it still doesnt seem to be working see here - http://www.betjeeves.com/test I want it to show the teams playing eachother and the odds in a table if thats possible? thanks for you help
  4. i have this xml file which i created for test purposes http://betjeeves.com/test.xmlI cant seem to figure out how to parse the data and which would be the best way to do it, i've looked at using Javascript but havnt ad any luck is this code useless? <script type="text/javascript">if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); }else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }xmlhttp.open("GET","odds_en.xml",false);xmlhttp.send();xmlDoc=xmlhttp.responseXML;document.write("<table border='1'>");var x=xmlDoc.getElementsByTagName("bets");for (i=0;i<x.length;i++) { document.write("<tr><td>"); document.write(x[i].getElementsByTagName("choice name")[0].childNodes[0].nodeValue); document.write("</td><td>"); document.write(x[i].getElementsByTagName("odd")[0].childNodes[0].nodeValue); document.write("</td></tr>"); }document.write("</table>");</script> I just want to be able to sort that xml data into a neat html table that displays the teams that are playing eachother and the odds.Please somebody help me from pulling my hair out Thanks
×
×
  • Create New...