I am trying to open some content in new tab or new window. The code which I am trying is
var w = window.open();
$(w.document.head).html("<link rel='stylesheet' href='style.css'/>");
$(w.document.body).html(data);
where data represents the html contents that is to be placed on the new window.The problem is that when opening new window all content is appearing, but its styles are missing. While checking tag in head shows undefined. How can I display the data in new window with proper styles?