XML : Can't get text from XML and image link to the video

I am trying to get the title of the image to display underneath the image the and the image to go to the video on the other site as that isn't happening now.

   <div id="container">          <table id="txxx"></table>              <script>                // Initialize          (function() {                   loadXMLDoc_txxx(start,end);                   })();             function loadXMLDoc_txxx(start,end) {            var xmlhttp = new XMLHttpRequest();            xmlhttp.onreadystatechange = function() {              if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {                myFunction_txxx(xmlhttp,start,end);              }            };            xmlhttp.open("GET", "txamateur.xml", true);            xmlhttp.send();          }          function myFunction_txxx(xml,start,end) {            var i;            var xmlDoc = xml.responseXML;            var table="<tr></tr>";            var x = xmlDoc.getElementsByTagName("video");                  for (i = start; i <end; i++) {                 if(x[i]){                  var K = x[i].getElementsByTagName("thumbnail");                    for (y = 0; y <K.length; y++) {                         var img = x[i].getElementsByTagName("thumbnail")[0].childNodes[0].nodeValue;                  }                var link = 'javascript:';              table +=                 "<a href='"+link+"'><img src='"+img.replace(';','')+"'></a>";                }                }            document.getElementById("txxx").innerHTML = table;                          var total_records = x.length;  //count number of records              var total_pages = Math.ceil(total_records / perpage);            loadPagination(page,total_records,total_pages);          }                      </script>        </div>    

Here is what the xml looks like, I has slightly been changed because it is slightly inappropriate

  <video>  <ID>272500</ID>  <title>the title of the video </title>   <url>http://www.fdaffd.com/videos/272500/e/?promo=12305</url>    <tags>a, b, c</tags>  <views>7098</views>  <thumbnail>http://static4.tubecup.org/contents/videos_screenshots/272000/272500/240x180/1.jpg</thumbnail>  </video>    

No comments:

Post a Comment