When making a service call using ajax and loading an HTML content on my page, the content includes text, external script calls, and CSS. However, upon loading, the HTML appears distorted for a few seconds before the JS and CSS are applied. Is there a solution to load the HTML with JS and CSS already applied, so it displays correctly immediately?
$.ajax({
type: 'POST',
url: service-URL,
crossDomain : _crossDomain,
contentType : 'text/plain',
data:JSON.stringify(objReq),
error:function (xhr, ajaxOptions, thrownError){
},
success: function(outputHTML){
$("#contentDiv").html(outputHTML);
}
});