SO CSS styles won't refresh after AJAX runs
http://stackoverflow.com/a/18648985/1370556
HTML
<div id="index">
<div id="contentcontainer"></div>
<button id="appendBtn" type="button">Append</button>
</div>
CSS
#index {
background-color:#82e4e5;
}
#portfolio {
background-color:#fb5656;
}
JavaScript
// Not sure where you're getting divID from
var divID = "portfolio";
$("#appendBtn").click(function (e) {
$.ajax({
//type: "GET",
//url: pageToLoad,
type: 'post', // For Ajax Echo
url: "/echo/html/", // For Ajax Echo
async: false, // Do you really need this?
// For Ajax Echo - NOTE THE SURROUNDING DIV
data: {
html: '<div><div class="content" id="portfolio"><div class="wrapper"><h2>Portfolio</h2><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras vestibulum libero non egestas dapibus. Nam gravida, libero ac posuere eleifend, mauris nisi venenatis metus, non hendrerit magna justo eget lectus.</p></div><!--wrapper--><div class="clear"></div></div><!--content--></div>'
},
success: function (data) {
// Remove trigger and use a better selection format
$(data).appendTo('#contentcontainer');
}
});
});