I'm working on an application which shows images. When the user scrolls down, it will update the div. My method works, but it doesn't really update the div. It clears the div and adds new content to it. So, how would I update the DIV?
At the moment I'm using this line of code. It will be called when the user is at the bottom of my div
document.getElementById("myDiv").innerHTML = result + '<br /> <img src="/images/loading.gif" />';
At the top of my code I'm defining result. Result contains the current pictures the div has:
result = result + '<img src="' + data.data[i].images.normal + '" /><br /><hr />';
So, I would like "loading.gif" to be added to the div. But as you can see, it will completely remake the div (it will reload the div) which is not optimal for users with a slow internet connection.
Thanks!
and
. The image shows up with some info below it (e.g. '
This image has ' + data.data[i].votes 'votes
– Stefan R Jul 04 '13 at 12:33