9three Posted October 4, 2009 Share Posted October 4, 2009 Hey, I'm calling a dynamic php file on click. It retrieves HTML/dynamic info. When I click once, because the DIV is empty, it works perfectly. The problem is when there is content there already. Is there a way to get rid of the HTML thats there already, and THEN load the new HTML? $('#random').click(function () { $.ajax({ type: 'POST', url: 'ajax/ajax.getInfo.php', cache: false, success: function (html) { $('.infoContainer').append(html); } }); }); If I've already clicked on the link then it will append the latest request to the bottom. Anyone know how I can accomplish this? thanks Link to comment https://forums.phpfreaks.com/topic/176481-solved-ajax-call-stacking-html/ Share on other sites More sharing options...
9three Posted October 4, 2009 Author Share Posted October 4, 2009 I found out how to do it. Using the empty() function will work just fine. Thank you anyway. Link to comment https://forums.phpfreaks.com/topic/176481-solved-ajax-call-stacking-html/#findComment-930293 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.