1) I have 2 different domains i) www.xxx.xom ii) www.yyy.com
2) then sent server call from xxx page to yyy page by ajax
3) get html content from yyy to xxx page (content contain html data with inline css)
4) Now i want to append response (html content) into my DOM But without css conflict (It means response content does not affect by parent css)
Note: is there any possible to render without IFRAME
Sample code:
document.onreadystatechange = function () {
if (document.readyState == "interactive") {
var ajax_response = "<div style='color: blue;'>I m blue </div>"; // sample server reponse
document.getElementById("child").innerHTML = ajax_response;
}
}
#parent div {
color: red !important;
}
<div id="parent">
<div>I m red</div>
<div id="child"></div>
<div>I m red too</div>
</div>
Output: red color will be applied for "I m blue" text (Because of '!important' tag)