日期:2014-05-16 浏览次数:20427 次
<script language="javascript" type="text/javascript"> function ShowDomain(isLink, id, setevent, setStyle) { 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", "http://niceloo.com/Domain.xml", false); xmlhttp.send(); xmlDoc = xmlhttp.responseXML; var xmlDomin = xmlDoc.getElementsByTagName("DomainID"); var strDomsel = ""; if (isLink == true) { strDomsel += "<select id=\"" + id + "\" " + setevent + " " + setStyle + "> <option value=\"http://www.geedu.com\">全国分校</option>"; for (var i = 0; i < xmlDomin.length; i++) { strDomsel += " <option value=\"http://" + xmlDomin[i].getAttribute("ID") + ".geedu.com\">" + xmlDomin[i].childNodes[0].nodeValue + "分校</option>"; } } else { strDomsel += "<select id=\"" + id + "\" " + setevent + " " + setStyle + ">"; for (var i = 0; i < xmlDomin.length; i++) { strDomsel += "<option value=\"" + xmlDomin[i].getAttribute("ID") + "\">" + xmlDomin[i].childNodes[0].nodeValue + "分校</option>"; } } strDomsel += "</select>"; return strDomsel; } window.onload = function () { var showdomid = document.getElementById("show1s"); showdomid.innerHTML =ShowDomain(false, "changeSchoolShowAd", "onchange=\"showSchool(this.value);\"", "style=\"margin-top:40px;\""); ; }