AJAX .load lagging after multiple calls
So basically, I have a very simple HTML/JS page with some clickable book
covers (.booklink). When you click on one of the covers, a description of
the book is loaded in a div (#book).
$(".booklink").on("click", function(){
$("#book").load('parts/' + $(this).attr("name") + '.html');
});
Now at first this works perfectly, but after clicking a few times, it
starts lagging. After about 10 clicks my browser even crashes completely.
I've tried using .empty() before calling the .load, but I still get the
same result.
Is there anything I can do about this? Am I doing something wrong? Is this
just how AJAX works?
Any help is appreciated!
No comments:
Post a Comment