HTMLView Error
BlitzMax Forums/MaxGUI Module/HTMLView Error
| ||
Hi, I use a HTMLView gadget to display some text: Global HTMLView1:TGadget = CreateHTMLView:TGadget(272, 16, 577, 445, MakeMods:TGadget, Null) HtmlViewRun:String(HTMLView1:TGadget, "document.write('<html><head><script language=\'Javascript1.2\'><!--function printpage() {window.print();}//--></script></head><body>Visit www.LogicZone.de</body></html>');") However, when I send HtmlViewRun:String(HTMLView1:TGadget, "javascript:printpage()") I get an error for ... Using the print command of the context menu works fine. When I exclude the printpage function from the document and send window.print() instead nothing happens ... Maybe somebody knows the error? Thanks, Andre |
| ||
What OS are you on, and which versions of BlitzMax and the MaxGUI drivers do you have? |
| ||
Hmm.. the issue seems to be with window.print. As replacing it with an alert works fine.. edit: im testing this with IE6 edit2: oh, and the error you get is probably because of the <!-- and --> comments (removing them gets rid of the error atleast) |
| ||
I start with BM 1.26 and just update to 1.28 under Windows XP / IE 6 ... Grable is right, deleting <!-- and --> removes the error but didn't make it woking. Also I tested alert('Test') and agree that it works fine. However I need to print and no alert :-) |
| ||
I looked over the source for the htmlview, and found out that you can do GadgetPrint(htmlview), havent seen that one before =) |
| ||
Thanks grable it works fine with GadgetPrint. As you can't do any page settings with window.print too it doesn't depend what of both to use... |