开发者

Add Jquery Load Contents to Existing Div Content

well right now I basically have the jquery load function like this

$('#results').load("sources.php?source=1&page=<?=$_GET['page']?>&search=<?=$_GET['search']?>");

so it's loading t开发者_StackOverflow中文版hat to the results div, but right after that i'd like to run essentially the same thing but

$('#results').load("sources.php?source=2&page=<?=$_GET['page']?>&search=<?=$_GET['search']?>");

how could i make it so it simply adds the content of the second load to the results div, as oppose to just replacing the existing content?

Thanks


You could use the get()-function instead of load().

$.get(url, function(data) {
   $('#results').append(data);
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜