I am on a page where I have some nifty graphs (made in css/html). I'd like to pass the contents of these graphs to another pop up page in case the user would like to print. I've grabbed the entire containing div element on my page and want to pass it the page below. The content is being passed in fine, but I can't figure out how to change the content of the page. I keep getting $('print_content') is null. Any help would be great.
Code:
function print_window(css_id)
{
var content = $(css_id); if(!content) return;
var win = window.open('/ajax/print.php', 'print');
$('print_content').replace(content.innerHTML);
console.log(content.innerHTML);
console.log(win.document);
}
=========================================================
<html>
<head>
<title> </title>
<link rel="stylesheet" type="text/css" href="/css/style.css" />
<script type="text/javascript" src="/js/prototype/prototype.js"></script>
<script type="text/javascript">
</script>
</head>
<body>
<div style="margin:30px;">
<div class="h2" style="width:574px;"><?php echo $title; ?></div>
<div id="print_content">
</div>
</div>
</body>
<html>