[align=center]XML格式是<?xml version="1.0" encoding="utf-8" ?>
<Root>
  <Item id="indexProfile">
    <Profile>
      Jquery需要获取的文本值
    </Profile>
  </Item>
</Root>下面是我写的jQuery    $.ajax({
        type: "GET",
        url: "content/xmlData/CategoryData.xml",
        dataType: "xml",
        success: function (xml) {
            var indexProf = $(xml).find("Item[id='indexProfile']").children("Profile").text();
            $(indexProf).appendTo("div.eightcol last");
        },
        error: function () {
            alert("你的浏览器不支持!");
        }
    });下面是Jquery appendTo的div<div class="eightcol last"></div>
[/align]
用firefox调试,为什么返回的是一个object,不能显示在html页面中的div内

解决方案 »

  1.   

    ("div.eightcol last").appendTo(indexProf);
      

  2.   

    ("div.eightcol last").html(indexProf);这样也行?应该~·
      

  3.   

    appendTo("div.eightcol last");
    用div.eightcol last不对,选择不到div,这个是选择div.eightcol里的last标签
      

  4.   

    $(indexProf).appendTo("div.eightcol.last");
    试试吧
      

  5.   

    class名你加空格干什么,这不就影响css了
      

  6.   


    $("<div class=\"eightcol last\"></div>").html(indexProf).appendTo("div#wrap-inner-about");我补个正解
      

  7.   


    $("<div class=\"eightcol last\"></div>").html(indexProf).appendTo("div#wrap-inner-about");我补个正解