jQuery:使用$ .load获取内容,结果格式如下:\ n \ n应用< \ / a> \ n< \ / div> \ n \ n

时间:2012-07-16 17:25:49

标签: jquery ajax

    nextPageURL = nextPage.find('a').attr('href') + '#searchResults';
    searchResults.append('<div class="moreList" />');
    $('.moreList').load(nextPageURL);
    var newHTML = $('.moreList').html().replace(/\s+<\/TD>/g,'');
    $('.moreList').html(newHTML);

这是它的要点。更多输出如下所示:

\n Android application design<\/a> <\/h3>\n

\n

Hourly<\/dt>\n
- Est. Time: Less than 1 week, 10 hrs\/week <\/dd>\n
- Posted <\/span> <\/dd>\n
- 3 Interviews<\/dd>\n <\/dl>\n <\/div> \n
\n \n Apply<\/a> \n <\/div>\n \n
<\/div>\n

帮助,太棒了!

1 个答案:

答案 0 :(得分:1)

只是一个猜测,但如果你使用这种语法:

$('#result').load('ajax/test.html #container');

你肯定错过#之前的空格。