I have a page that when the user clicks a button, it should open a popup and print it.
However, what I am doing is opening a blank page and writing on it, then telling it to print from the opener.
Nothing happens when I use this code:
Code:
//onclick fires this function:
function print_page()
{
//this part works fine...
var newpage = window.open("","newpage");
//this part works fine...
newpage.document.write("a bunch of data");
//this part does nothing!
newpage.window.print();
//I have also tried:
newpage.print();
newpage.document.print();
//and several other things...
}
Perhaps this is some sort of security issue? I get no errors, just nothing...
Thanks
Snib