I was wondering if anyone knew a better way to write this block of code.
if($('div.homeBox > div').length > 0){
$('div.homeBox > div').remove();
}
$('div.homeBox').append(data.loadPage);
This works as it is, but I would like to make it pretty if possible. I am replacing a block of code in my page with HTML data returned by an ajax request (data.loadPage).
An example of data.loadPage would be
<div id="variousIDs" >
... some content ...
</div >
Thanks in advance for any advice.