Jump to content

Reloading Div In A Popup


Recommended Posts

I'm trying to make a script that copies the content from a div to a new popup.For example:

<html><head><title>Test</title</head><body><div id="test"><p>Hello</p></div></body></html>

And this is the code I have atm:

function printTable(table) {	printPop = window.open('lol.php','Printversie','scrollbars=yes');	if (window.focus) printPop.focus();	code = document.getElementById(table).innerHTML;	printPop2 = printPop.document;	$(printPop2).ready(function(){		$(printPop2).$("#printContent").append(code);	});}

So I want that the popup (lol.php) will display something like this:


Link to comment
Share on other sites

Both alerts worked after I "cleaned" the code a bit.

function printTable(div) {	code = document.getElementById(div).innerHTML;	printpop = window.open('lol.php','Printversie','scrollbars=yes,height=200,width=200');	printpop2 = printpop.document;	if (window.focus) printpop.focus();	$(printpop2).ready(function(){		$("#printContent").append(code);	});}

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...