一、前端代码
//AJAX后台取数据
varxmlhttp=newActiveXObject("Msxml2.XMLHTTP");
varurl="/bsoa/config.nsf/GetPhoneNum?openagent";
xmlhttp.Open("POST",url,false);
xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
xmlhttp.setRequestHeader("setTimeOut","10000");
xmlhttp.Send("ok");//TransformCgi(
//返回值接收
//varreturnDOM=xmlhttp.responseXML;
document.getElementById("result").innerHTML=xmlhttp.responseText
//alert("XML数据原始文本内容为:"+xmlhttp.responseText);
二、后台代理
DimsAsNewNotesSessionDimdbAsNotesDatabaseDimdocAsNotesDocumentDimdcAsNotesDocumentCollectionDimviewAsNotesViewDimcdocAsNotesDocumentSetcdoc=s.DocumentContextparList=Trim(cdoc.GetItemValue("Request_content")(0))MessageBoxparListSetdb=s.CurrentDatabaseSetview=db.GetView("VTableWh2")Setdoc=view.GetFirstDocumentxml="<tableclass=tableborderwidth='70%'cellspacing='1'cellpadding='4'align='center''>"xml=xml+"<thclass='trDescribeCenter'><thclass=tdDescribeCenterwidth=10%>序号</td>"xml=xml+"<thclass='tdDescribeCenter'width=10%>姓名</td>"xml=xml+"<thclass='tdDescribeCenter'width=10%>职务</td>"xml=xml+"<thclass='tdDescribeCenter'width=10%>分机</td>"xml=xml+"<thclass='tdDescribeCenter'width=15%>直线电话</td>"xml=xml+"<thclass='tdDescribeCenter'width=15%>手机</td>"xml=xml+"<thclass='tdDescribeCenter'width=15%>传真</td>"xml=xml+"<thclass='tdDescribeCenter'width=15%>房间号</td></tr>"temp1=""i=1WhileNotdocIsNothingIfdoc.TSeqNo(0)="01"Then//安装序号大小将新的部门名称单独显示为一行temp1="<tr><tdcolspan=8class=tdborder><b>"+doc.TDepartment(0)+"</b></td></tr>"temp1=temp1+"<tr><tdclass=tdborderalign=center>"+doc.TSeqNo(0)+"</b></td>"Elsetemp1="<tr><tdclass=tdborderalign=center>"+doc.TSeqNo(0)+"</b></td>"EndIf'超链接'temp1=temp1+"<tdclass=tdborder>"+doc.name(0)+"</td>"temp1=temp1+"<tdclass=tdborder><ahref=/bsoa/config.nsf/0/"+doc.UniversalID+"?OpenDocumenttarget='_blank'>"+doc.name(0)+"</a></td>"Ifdoc.HasItem("TRank")Thentemp1=temp1+"<tdclass=tdborder>"+doc.TRank(0)+"</td>"Elsetemp1=temp1+"<tdclass=tdborder></td>"EndIfIfdoc.HasItem("Tel")Thentemp1=temp1+"<tdclass=tdborder>"+doc.Tel(0)+"</td>"Elsetemp1=temp1+"<tdclass=tdborder></td>"EndIfIfdoc.HasItem("Tel2")Thentemp1=temp1+"<tdclass=tdborder>"+doc.Tel2(0)+"</td>"Elsetemp1=temp1+"<tdclass=tdborder></td>"EndIfIfdoc.HasItem("TMTel")Thentemp1=temp1+"<tdclass=tdborder>"+doc.TMTel(0)+"</td>"Elsetemp1=temp1+"<tdclass=tdborder></td>"EndIfIfdoc.HasItem("Fax")Thentemp1=temp1+"<tdclass=tdborder>"+doc.Fax(0)+"</td>"Elsetemp1=temp1+"<tdclass=tdborder></td>"EndIfIfdoc.HasItem("TRoom")Thentemp1=temp1+"<tdclass=tdborder>"+doc.TRoom(0)+"</td></tr>"Elsetemp1=temp1+"<tdclass=tdborder></td></tr>"EndIfxml=xml+temp1Setdoc=view.GetNextDocument(doc)i=i+1WendMessageBoxCstr(i)xml=xml+"</table>"cdoc.rtfThemesHtmlMX(0)=xml'Print"Content-type:text/xmlcharset=GB2312"'Print|<?xmlversion="1.0"encoding="utf-8"?>|Print"Content-type:text/xml;charset=GB2312"'指定页面编码注意Print|<?xmlversion="1.0"encoding="GB2312"?>|'指定XML文件编码Printxml
原文链接:https://www.f2er.com/ajax/165450.html