Belgin Fish
Belgin Fish

Reputation: 19827

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 that 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

Upvotes: 0

Views: 1980

Answers (1)

Aleksi Yrttiaho
Aleksi Yrttiaho

Reputation: 8446

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

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

Upvotes: 2

Related Questions