print () essentially just calls the native print dialog for the given window.
But, as you think, it will work in any window or (i) frame.
Thus, if you write content in a frame, you can call it to print it. A.
window.frameName.print();
Please note that the only drawback (and its biggest) is that it causes the print dialog ... not the print preview ... so the user really has no way to see what they print and / or scale it so that it matches their printer / paper.
I personally wish all browsers implement the following to deal with the above problem .; -)
window.printPreview();
scunliffe
source share