I'm following this example: Write Content To New Window with JQuery to popup a div in a new window. The problem is that I also need to include the css and script files.
Code:
var w = window.open();
var html = $("#modal").html();
$(w.document.body).html(html);
It works fine but looks ugly.
How can I add the css and the js script to the header?
This is working:
$(w.document.head).append('<link rel="stylesheet" href="plugin/flexigrid/css/flexigrid.pack.css" />');
But this is not:
$(w.document.head).append('<script src="plugin/flexigrid/js/flexigrid.js"><\/script>');