Code:
function showAll() {
$.post("/listAll.html", function(data) {
$("#targetDiv").html(data);
});
}
OR
Code:
var globalFlag = 0;
function showAll() {
$.post("/listMore.html", function(data) {
if(globalFlag == 0) {
$("#targetDiv").append(data);
globalFlag = 1;
}
});
}
Both codes are jQuery.
If you want to get really creative, you can just store everything in one file and separate it with a string you're unlikely to encounter in HTML and do this:
Code:
var globalFlag = 0;
function showAll() {
$.post("/listMore.html", function(data) {
if(globalFlag == 0) {
temp = data.split(String.charCodeAt(126)); // Find a character you'll never use in your actual document for this purpose
$("#targetDiv").append(temp[0]);
$("#targetDiv2").append(temp[1]);
$("#targetDiv3").append(temp[2]);
globalFlag = 1;
}
});
}