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 Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.