I have an AJAX call to a server that will return an HTML response. This HTML response will include HTML, CSS, and JS. I would like to embed this response on my current page so the user will be able to view the response. I have tried the following, but the CSS from the response is applied to my current page. Is there any way to prevent the CSS from being applied to my current page?
Note that I have no control over the CSS returned by the server. The server can return CSS that targets all element types p { color:red }
:(
$.ajax ({
type: TYPE,
contentType: CONTENT_TYPE,
url: URL,
headers: {
firstName: firstName,
lastName: lastName
}
})
.done( function(msg) {
$('#response').html(msg);
})
<div id="response"></div>