[英]limit 12 images displying at a time and automatically create pages for the 10000 rest
I am try to get 12 images to diplay at a time instead of displaying the 10,000. 我尝试一次显示12张图像,而不显示10,000张。 Someone has told me what to do but Im not sure how to do it.
有人告诉我该怎么做,但我不确定该怎么做。
This is what they said to do: 他们说要这样做:
This is where he said to do it 他说是在这里做的
<div id="container">
<table id="demo"></table>
<script>
// Initialize
(function() {
loadXMLDoc();
})();
function loadXMLDoc() {
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
myFunction(xmlhttp);
}
};
xmlhttp.open("GET", "amateur.xml", true);
xmlhttp.send();
}
function myFunction(xml) {
var i;
var xmlDoc = xml.responseXML;
var table="<tr></tr>";
var x = xmlDoc.getElementsByTagName("video");
for (i = 0; i <x.length; i++) {
var img = x[i].getElementsByTagName("thumbnail")[0].childNodes[0].nodeValue;
var url = x[i].getElementsByTagName("url")[0].childNodes[0].nodeValue;
table +=
"<a href='"+url+"'><img src='"+img+"'></a>";
}
document.getElementById("demo").innerHTML = table;
}
</script>
It looks like a homework, hints: 它看起来像是一项作业,提示:
Good luck 祝好运
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.