[tr][td]清单 4. loadDeals 函数
var deals = []; var sections = []; var dealDetails = {}; var dealsUrl = "http://deals.ebay.com/feeds/xml"; function loadDeals(){ var xhr = new XMLHttpRequest(); xhr.onreadystatechange = function(){ if (this.readyState == 4 && this.status == 200){ var i = 0; var j = 0; var dealsXml = this.responseXML.firstChild; var childNode = {}; for (i=0; i< dealsXml.childNodes.length;i++){ childNode = dealsXml.childNodes.item(i); switch(childNode.localName){ case 'Item': deals.push(parseDeal(childNode)); break; case "MoreDeals": for (j=0;j |
|