| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 3969 人关注过本帖
标题:请教关于responseXML为空或null的错误?
只看楼主 加入收藏
lxd824
Rank: 1
等 级:新手上路
帖 子:135
专家分:0
注 册:2007-4-21
收藏
 问题点数:0 回复次数:2 
请教关于responseXML为空或null的错误?
客户端采用prototype.js框架
CallBack为:
function getData(og)
{
var pc =og.responseXML.getElementsByTagName("BudgetStyle");
//这里出错:提示responseXML为空或不是对象,但下面的代码仍然运行,也能够获取数据,页面显示正常。
//用alert(responseText)能获取正常数据(汉字乱码),错误提示:responText为空或不是对象
  if(pc != null)
 {
  for(var i = 0; i < pc.length; i++)
 {
    var bs =  pc[i].getAttribute("BS");
    var id = pc[i].getAttribute("ID");
    var op = new Option(bs,id);
    sc.options.add(op);
  }
  }
}

服务端:(采用.net的ashx文件)
 context.Response.ContentType = "text/xml;charset=gb2312";
        context.Response.Charset = "GB2312";
        string pid = context.Request.QueryString["pid"].ToString();
        string type = context.Request.QueryString["type"].ToString();
        string data = "<P>" + getData(pid, type) + "</P>";
        context.Response.Write(data);
搜索更多相关主题的帖子: null responseXML 
2008-12-09 11:19
快速回复:请教关于responseXML为空或null的错误?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016408 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved