jquery ajax parse response text

Ok this is really frusturating me because I've done this a hundred times before, and this time it isn't working. So I know I'm doing something wrong, I just can't figure it out. I am using the jQuery .get routine to load html from another file. I don't want to use .load() because it always replaces the children of the element I'm loading content into. Here is my .get request: $(document).ready(function() { $.get('info.html', {}, function(html) { // debug code console.log($(html).find('ul').html()); // end debug code }); }); The file 'info.html' is a standard xhtml file with a proper doctype, and the only thing in the body is a series of ul's that I need to access. For some reason, the find function is giving me a null value. In firebug, the GET request is showing the proper RESPONSE text and when I run console.log(html); Instead of the current console.log line, I get the whole info.html as output, like I would expect. Any ideas?

以上就是jquery ajax parse response text的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » jQuery 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准