hi everybody!!
I just found a useful code to print an external html file with no need of opening it...
it works fine as long as the button is in a html page with no frame, but I need to use it in a frameset.
so: this code works if I open directly the bar-file and click on the print button, but when I open the whole html file (text + bar) it will print the bar-page.
I tried adding the "head" code in the main file too, but this way it would lose the "href" and try to print a "something" file...
what I seem to understand is that somehow I should change a path and/or a variable in the function in order to make it work..but I really don't know what... thanks for your help!!
this is the code:
HTML Code:
[HEAD]
[link id="prt" name="prt" rel=alternate media=print href="something"/]
[script]
function printWindow(){
bV = parseInt(navigator.appVersion)
if (bV >= 4) window.print()
}
function setPrintedPage(altdoc) {
var prt;
var prt = document.getElementsByTagName("link")[0];
prt.setAttribute("href", altdoc);
printWindow();
}
[/script]
[/HEAD]
[BODY]
[img src="print.gif" onClick="setPrintedPage('document1.htm');">
[/BODY]
uh uh! time for making apologies...
hi warren, I beg your pardon for my lack of netiquette...
would you please consider English is not my mother tongue... actually I had to take my dictionary to catch the meaning of your first line.
You see... I was only trying to "push" and provoke some reaction, I apologize for sounding arrogant.
anyway, thank you very much...the script is simply perfect!! and quite "didactic" too... now I know about the "parent" path issue...
thanks again!!
i have used the code for printing php page.passing the php values works fine but how to pass the html form values.i m not getting the html form values plz help me
this is my code
It only prints the actual page the link image is on. I have inserted 10 different URLs in replace of 'document1.htm' and none of them printed. Only this page gets printed.
Bookmarks