[置顶] 欢迎您。今天是2023年03月30日。

最近在搞extjs,使用的版本是2.2,服务器端采用asp,方便省事。asp好久没摸了,以前关于这块的内容不知道放哪去了,反正是在电脑里,巴拉老半天也找不到,所以还是重新搞一搞吧,搞了老半天才搞出个模样,还是记录一下吧,免得又忘了。

asp:

Response.CharSet = "utf-8"
Set xmlhttp = Server.CreateObject("Microsoft.XMLHTTP")
xmlhttp.Open "GET","http://localhost/ext2.2/my/form1.asp",False '动态生成的xml
xmlhttp.Send
Set xml = Server.CreateObject("Msxml2.DOMDocument")
xml.async = false
'xml.load(Server.Mappath("2.xml")) ’可以使用本地的xml,如果想使用远程的xml必须用上面的xmlhttp方式获取
xml.loadxml(xmlhttp.responseText)
Set xsl = Server.CreateObject("Msxml.DOMDocument")
xsl.async = false
xsl.load(Server.Mappath("1.xsl"))
Response.Write xml.transformNode(xsl)
Set xmlhttp = Nothing
Set xml = Nothing
Set xsl = Nothing

javascript:

var xml = new ActiveXObject("MSXML.DOMDocument");
xml.async = false;
xml.load("http://localhost/ext2.2/my/form1.asp");
var xsl = new ActiveXObject("MSXML.DOMDocument");
xsl.async = false;
xsl.load("http://localhost/ext2.2/my/1.xsl");
alert(xml.transformNode(xsl));

您可能也喜欢

动态联接库(DLL)可以加快应用程序关键部分的执行速度,同时通过统一的COM接口调用,对DLL的使用也可以最大限度地发挥组件的重用性。用户不必关心DLL采用什么语言编写,只需关注其提供了哪些功能及接口参数,便可以为我所用。目前,基于.Net技术编写的DLL组件越来越多,而传统的ASP中如果也可以应用这些组件提供的功能,可以避免很多程序员无谓的劳动。

二维码
摄像头