Click to See Complete Forum and Search --> : printing the amin frame, pressing a button in a pop-up


snuffed
10-24-2003, 10:19 AM
Hi everyone,

Can anyone give me some advice on how to print the frame "main" using a button in the pop-up navigator.

I'm trying to create something like a remote controll, but unfortunately i'm still very new to Javascript. The printing script looks as follows:

SCRIPT LANGUAGE="JavaScript">

<!-- Begin
function myprint() {
window.parent.main.focus();
window.print();
}
// End -->
</script>

Same thing for a back button using the:

javascript:top.history.back()

script.

I'm not sure if this is even possible, but I would be thankfull for every little bit of help offered.

Just one more question: Do Pop-Ups have a minimum size of 150*100? I can't seem to get mine any smaller.

Well, thanx in the meanwhile.
I look forward to your replie.

Simon

Khalid Ali
10-24-2003, 11:11 AM
instead of

window.parent.main.focus();
window.print();

try something like this

top.opener.parent.main.focus();
top.opener.parent.main.print();

snuffed
10-25-2003, 06:52 AM
Thanx Ali for the usefull advice.

It worked, at least in the case of the print function.

Unfortunately, I'm still left with a few problems, and I was wondering weather you might have some more advice for me.

I tried using your same piece of code for the history button:

top.opener.parent.main.focus();
javascript:top.history.back();


but this didn't seem to work. I then tried several other methods, but they all failed to back-button the frame main.

Furthermore, is it possible to keep the pop-up above the main window, and if so, how?

One last one: Do Pop-ups have a minimum Size of 150*100, since I can't seem to make mine any smaller...

I very much look forward to your reply, and once again would like to thank you in the meanwhile. Adios.

PS.: Sorry about the, maybe a-little-stupid questions, but I am still very new to Java, and it is proving not to be as easy to learn as I had hoped...