Hi Carlos, the list,
tested with the most recent REALbasic version on MacBook / macOS X 10.5.7:
>Load a Page:
>HTMLViewer1.LoadURL "http://www.example.com";
Load the page if it is available ;-)
BUT ONLY IF YOU REMOVE THE ENDING ';'
>HTMLViewer1.LoadURL("javascript:void(window.print());")
>HTMLViewer1.LoadURL("javascript:window.print();")
>HTMLViewer1.LoadURL("javascript:self.print();")
>HTMLViewer1.LoadURL("javascript:this.print();")
None of these works :(
>Note: The browser must have javascript enabled.
On MacBook, it seems that HTMLViever’s JavaScript is enabled.
How to check if JavaScript is enabled ?
For testing pueposes, place the following code in your html test file:
I got: “Is Java enabled? true” when I added the above line in a local html
file, then loaded in an HTMLviewer [remember MacBook]
NOTA: I took the advice à la lettre; I only placed one of the HTMLViewer line
(the others were commented):
Function FilePrint() As Boolean
'HVHelp.LoadURL("javascript:void(window.print());")
'HVHelp.LoadURL("javascript:window.print();")
'HVHelp.LoadURL("javascript:self.print();")
'HVHelp.LoadURL("javascript:this.print();")
// load a new page from hard disk
HVHelp.LoadURL
"file:///FireFox%20Downloads/REALbasic%202009r3/Help/index_cretxt.html"
// try to print
HVHelp.LoadURL("javascript:this.print();")
End Function
Nothing happens.
Emile
>For future reference here are some ways using javascript to print a
>page with HTMLViewer.
>
>Load a Page:
>
>Print the page using javascript:
>(Any of the following works on Windows with an HTMLViewer. Not tested
>on MAC, but probably one of the javascript instructions might work)
>HTMLViewer1.LoadURL("javascript:void(window.print());")
>HTMLViewer1.LoadURL("javascript:window.print();")
>HTMLViewer1.LoadURL("javascript:self.print();")
>HTMLViewer1.LoadURL("javascript:this.print();")
>
>Note: The browser must have javascript enabled.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
|