不知道doc你这个是什么对象,我用的是xmlhttp<?xml version="1.0" encoding="UTF-8"? > 
<request > 
   <city >zk </city >    
   <tab>www </tab > 
   <tab>error </tab > 
<request >var a1=xmlHttp.responseXMl.getElementsByTagName("tab")[0].firstChild.data;
var a2=xmlHttp.responseXMl.getElementsByTagName("tab")[1].firstChild.data;

解决方案 »

  1.   

    关键在id上,我向disp(doc,id) 中id传递值a1,并在xml根据id="a1"取出数据,ff中行但在ie6.0中报错没有对象
      

  2.   

    doc对象我已处理过了的,可在ie或ff中用
      

  3.   

    兼容问题,用兼容方法做,可能你这个做法只能用在FF,开发环境 改ie吧,现在用ie的 还是 比较多
      

  4.   

    用DOM来解析吧function disp(doc,id){
         for (var i = 0; i < doc.getElementsByTagName( 'tab ').length; i++)
         {     
              if (doc.getElementsByTagName( 'tab ')[i].getAttribute("id") == id)
              {
                   $( 'mainlist ').innerHTML = doc.getElementsByTagName( 'tab ')[i].firstChild.nodeValue;
                   break;
              }
         }