I have a WebHTML Viewer on a page that is set to show an HTML file that I have dragged into my project.
I’m having trouble working out what to put as the path where the xxx’s are below:
This is running on OSX 10.8.4
You need to use a WebFile. Make a property in your project, somewhere global, name it jscode. Then in app.open:
Jscode = new WebFile
Jscode.Session = Nil // this makes it available to any session
Now, in your HTML, insert jscode.URL and it will point to the right location.
Thanks for your reply, I followed your instructions and managed to get the page to load correctly.
Following on from Antonis’ comments, is there an easy way to do this if you need to load lots of libraries?
I guess I could create an array of WebFiles and store them all there?
[quote=29930:@Paul Finer]Following on from Antonis’ comments, is there an easy way to do this if you need to load lots of libraries?
I guess I could create an array of WebFiles and store them all there?[/quote]
If the libraries are hosted somewhere else, then just reference them directly from there. If you need/must keep them local, then use the CGI deployment option (instead of standalone*) and store the files on your server and let the web server handle them.
- You can also do this in standalone if you run it behind a reverse proxy or something similar.
Another solution would be to write your own handler using the App.HandleSpecialURL. You could handle things called to /api/assets/ as pointing to your desktop or something like that.
The problem is that you really shouldn’t blindly send files down to the browser. A Mime Type should always be included. While most browsers will figure it out on their own, you may not always be so lucky.
It’s working on windows all browsers …
on a css file, i have the following command :
on HandleSpecialURL, I have the following code :
[code] dim fPath as string = Request.Path
dim f as FolderItem
dim mb as MemoryBlock
dim bs as BinaryStream
f = GetFolderItem(“xojoImages/” + fPath)
if f.Exists then
bs = bs.Open(f,False)
mb = bs.Read(bs.Length)
So, when the css file calls the image url, then through HandleSpecialURL event, it download it on browser.
Thanks Greg again…
I hope, that it does not holds the image on memory and clean the variables when the procedure returns. Correct ?
Yes. Everything gets reset.