[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内
<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内
解决方案 »
- phonegap写安卓程序问题
- javascript能不能实时读取txt内容
- [转]能说明你的Javascript技术很烂的五个原因
- 求一个js的正则表达式~~
- 请教c#中使用JavaScript问题
- 请问csdn上的在线编辑器里面的[code][/code]之间的代码是怎么识别的(自动排版)
- eclipce3.4为什么安装spket不能使用呢?
- 动态添加行的问题
- 为啥有的ie浏览器popup窗口弹不出来呢?
- 请问,我能否在一个FORM里有多个type为submit的按钮呢?他们的action都为一致的.
- ext2.1 中文 api 打开后一直停留在加载状态转圈圈,好几种浏览器都不行
- jquery如何写类似a:hover这种的css
用div.eightcol last不对,选择不到div,这个是选择div.eightcol里的last标签
试试吧
$("<div class=\"eightcol last\"></div>").html(indexProf).appendTo("div#wrap-inner-about");我补个正解
$("<div class=\"eightcol last\"></div>").html(indexProf).appendTo("div#wrap-inner-about");我补个正解