function _dynclicks_ajax() { var xmlhttp = null; try { xmlhttp = new activexobject("microsoft.xmlhttp"); } catch(e) { try { xmlhttp = new activexobject("msxml2.xmlhttp"); } catch(e) { try { xmlhttp = new xmlhttprequest(); } catch(e) { } } } return xmlhttp; } function _showdynclicks(clicktype, owner, clickid) { try { var uid = "dynclicks_" + clicktype + "_" + clickid + "_" + (math.floor(math.random()*1000)); document.write(""); var url = '/system/resource/code/news/click/dynclicks.jsp?clickid='+clickid+'&owner='+owner+'&clicktype='+clicktype; var xmlhttp = _dynclicks_ajax(); xmlhttp.onreadystatechange = function(){_onshowdynclicks(xmlhttp, uid);}; xmlhttp.open("get",url, true); xmlhttp.send(); } catch(e) { } } function _showdynclickbatch(spanids,wbnewsids,clicktype, owner) { if(spanids.length == 0 || wbnewsids.length == 0) return; var usespanids = new array(); var usernewsids = new array(); for(var i = 0; i < spanids.length; i++) { if(document.getelementbyid(spanids[i]) != null) { usespanids[usespanids.length] = spanids[i]; usernewsids[usernewsids.length] = wbnewsids[i]; } } if(usespanids.length == 0) return; try { var url = '/system/resource/code/news/click/dynclicksbatch.jsp?clickids='+usernewsids+'&owner='+owner+'&clicktype='+clicktype; var xmlhttp = _dynclicks_ajax(); xmlhttp.onreadystatechange = function(){_onshowdynclicksbatch(xmlhttp, usespanids);}; xmlhttp.open("get",url, true); xmlhttp.send(); } catch(e) { } } function _onshowdynclicksbatch(xmlhttp, uids) { if(xmlhttp.readystate == 4 && xmlhttp.status == 200) { var texts = xmlhttp.responsetext.split(","); for(var i = 0; i < uids.length;i++) { try { //针对2个内容重叠而且 id 相同时的处理方法 var imgobjs = document.getelementsbyname(uids[i]); for(var j = 0; j < imgobjs.length; j++) { imgobjs[j].innerhtml = texts[i]; } } catch(e) { } } } } function _onshowdynclicks(xmlhttp, uid) { if(xmlhttp.readystate == 4 && xmlhttp.status == 200) { try { document.getelementbyid(uid).innerhtml = xmlhttp.responsetext; //针对2个内容重叠而且 id 相同时的处理方法 var imgobjs = document.getelementsbyname(uid); if(imgobjs.length>0) { imgobjs[1].innerhtml = xmlhttp.responsetext; } } catch(e) { } } } function _adddynclicks(clicktype, owner, clickid) { try { var url = '/system/resource/code/news/click/addclicktimes.jsp?wburlid=' + clickid + '&owner=' + owner + '&type=' + clicktype; var xmlhttp = _dynclicks_ajax(); xmlhttp.open("get",url, true); xmlhttp.send(); } catch(e) { } }