<script type="text/javascript">
$(document).ready(function(){
$("#Btn").click(function(){
$.ajax({
type:"get",
url:"rss.htm",
dataType:"html",
beforeSend:function(){$("#show").html("数据加载中...")},
success:function(result){
$("#show").html("");
$(result).find("table").each(function(){
$(this).find("td").each(function(){
alert($(this).text());
})
})
}
});
})
})
</script>这样总是获取不到td下的内容
怎么回事呢?
$('table td',result).each(function(){
alert($(this).text());
});
$(document).ready(function(){
$("#Btn").click(function(){
$.ajax({
type:"get",
url:"rss.htm",
dataType:"html",
beforeSend:function(){$("#show").html("数据加载中...")},
success:function(result){
$("#show").html("");
$(result).find("table").each(function(index,tableDom){
$(tDom).find("td").each(function(index,tdDom){
alert($(tdDom).text());
})
})
}
});
})
})
</script>