flash 读xml带空格文件

来源:百度知道 编辑:UC知道 时间:2024/06/28 11:04:24
asp 输出 中国 湖南
flash text1显示中国 text2显示湖南
怎么写
System.useCodepage = true;
var myXML = new XML();
myXML.ignoreWhite = true;
myXML.load("http://localhost/untitled.asp");
myXML.onLoad = function(sc) {
if (sc) {
//处理XML对象的函数:
text1=(myXML.childNodes[0]);

}
}

如果以上程序怎么改

asp代码

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
set conn=server.createobject("adodb.connection")
conn.Open "Driver={Microsoft Access Driver (*.mdb)};Uid=;Pwd=;DBQ=" & Server.MapPath("db1.mdb")
set rs=Conn.Execute("select * from user ")
%>
<%
for i=1 to 2
%> <标题><%=rs("u_name")%></标题> <内容><%=rs("u_pass")%></内容> <发布日期><%=rs("u_tel&q

System.useCodepage = true;
var myXML = new XML();
//myXML.ignoreWhite = true;//不要这句
myXML.load("http://localhost/untitled.asp");
myXML.onLoad = function(sc) {
if (sc) {
//处理XML对象的函数:
var tempStr = this.toString();
var tempArr = tempStr.split(" ");
text1.text = tempArr[0];//如果text1是文本的变量名则去掉.text
text2.text = tempArr[1];//同上
}
}

中国 湖南之间如果用空格做分隔符的话,flash里接收过来再用split转成数组,text1显示数组的第一个元素,text2显示数组的第二个元素就可以了吧。