AJAX load div by div
AJAX load div by div
Hello!
This is my first post. I am running through this problem:
I have an external file (entries.html) with this structure:
-
<div>
Content 1
</div>
<div>
Content 2
</div>
.
.
.
<div>
Content n
</div>
I want to load that file div by div everytime a link is clicked. This is, at the beggining, I have the first div loaded. When the link is clicked, second div should be loaded, second click, third div... and so on.
This is what I have so far (not working at all):
-
$(window).load(function () {
$("#latest").load("entries.html I_WANT_FIRST_DIV");
$("#older").click(function () {
$("#latest").fadeOut(500, function() {
$("#latest").load("entries.html I_WANT_NEXT_DIV");
$("#latest").fadeIn(500);
});
});
});
Thank you very much
