jquery ajax 使用get()方法来读取XML文件 但是读不出来
我用的是jquery1.7的版本下面是XML的内容,这是个本地的文件<?xmlversion="1.0"encoding="UTF-8"?><entries><entry...
我用的是jquery1.7的版本
下面是 XML的内容,这是个本地的文件
<?xml version="1.0" encoding="UTF-8" ?>
<entries>
<entry term="DANCE" part="v.i.">
<definition>To leap about to the sound of tittering music, preferably with arms about your neighbor's wife or daughter. There are many kinds of dances, but all those requiring the participation of the two sexes have two characteristics in common: they are conspicuously innocent, and warmly loved by the vicious.
</definition>
</entry>
</entries>
下面是JS的内容
$('#letter-d a').click(function(){
$.get('d.xml',function(data){
$('#dictionary').empty();
alert(data);
alert($(data).length);
alert($(data).find('entry'));
$(data).find('entry').each(function(){
var $entry=$(this);
.......
});
});
return false;
});
alert()检测,弹出来是空的,求解释 展开
下面是 XML的内容,这是个本地的文件
<?xml version="1.0" encoding="UTF-8" ?>
<entries>
<entry term="DANCE" part="v.i.">
<definition>To leap about to the sound of tittering music, preferably with arms about your neighbor's wife or daughter. There are many kinds of dances, but all those requiring the participation of the two sexes have two characteristics in common: they are conspicuously innocent, and warmly loved by the vicious.
</definition>
</entry>
</entries>
下面是JS的内容
$('#letter-d a').click(function(){
$.get('d.xml',function(data){
$('#dictionary').empty();
alert(data);
alert($(data).length);
alert($(data).find('entry'));
$(data).find('entry').each(function(){
var $entry=$(this);
.......
});
});
return false;
});
alert()检测,弹出来是空的,求解释 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询