Page 1 of 1
WebGadget() - "file://"
Posted: Wed Nov 14, 2012 5:46 am
by J. Baker
Unable to load html files in the webgadget.
Re: WebGadget() - "file://"
Posted: Wed Nov 14, 2012 8:22 am
by jesperbrannmark
But.... without testing this..... Isn't this exactly how the Purebasic Help works? Isn't that a webgadget with a local file?
Re: WebGadget() - "file://"
Posted: Wed Nov 14, 2012 10:11 am
by IdeasVacuum
...on Windows the Help files are Microsoft .chm (Compiled HTML). They are displayed by the default Windows chm viewer.
Try passing the full path of the file to the WebGadget, excluding "file://"
Re: WebGadget() - "file://"
Posted: Wed Nov 14, 2012 11:46 am
by Fred
Yes, the help on OS X use the webgadget() with local files
Re: WebGadget() - "file://"
Posted: Wed Nov 14, 2012 2:07 pm
by jesperbrannmark
Code: Select all
OpenWindow(0,0,0,640,480,"")
WebGadget(0,0,0,640,480,"file://"+GetTemporaryDirectory()+"output.html")
Repeat
Until WaitWindowEvent()=#PB_Event_CloseWindow
this works fine for me...
Re: WebGadget() - "file://"
Posted: Wed Nov 14, 2012 4:01 pm
by IdeasVacuum
...could the issue be the files themselves? Perhaps they are HTML5 and the webgadget cannot interpret them?
Re: WebGadget() - "file://"
Posted: Wed Dec 05, 2012 4:27 am
by J. Baker
Yeah, it was a HTML5 file.
Re: WebGadget() - "file://"
Posted: Thu Dec 06, 2018 11:21 am
by collectordave
Having the same trouble with local files.
The web gadget displays them correctly in the windows version (win xp and win 7.0) but not on the mac.
Is the HTML 5 issue only on the mac?
CD
Re: WebGadget() - "file://"
Posted: Thu Dec 06, 2018 11:43 am
by Wolfram
Maybe a problem with the path.
Re: WebGadget() - "file://"
Posted: Thu Dec 06, 2018 11:54 am
by collectordave
Found the problem.
The file I was attempting to load had spaces in. Changed all these to %20 and It worked.
CD
Re: WebGadget() - "file://"
Posted: Thu Dec 06, 2018 5:00 pm
by Wolfram
Thats what I mean...
You can try the URLEncoder(URL$ [, Format]) to encode the path to a URL.
Re: WebGadget() - "file://"
Posted: Fri Dec 07, 2018 6:14 am
by collectordave
URLencoder worked first time. No problems on either platform now.
Must be getting old used that before and forgot.
Thanks for replies.
CD