开发者

Add Jquery Load Contents to Existing Div Content

开发者 https://www.devze.com 2023-02-20 05:31 出处:网络
well right now I basically have the jquery load function like this $(\'#results\').load(\"sources.php?source=1&page=<?=$_GET[\'page\']?>&search=<?=$_GET[\'search\']?>\");

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

精彩评论

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