Loading local html

This is the place to discuss anything relating to MobGUI

Moderators: heatherlaine, kevinmiller, robinmiller, malte, splash21

Post Reply
roddy
Posts: 40
Joined: Tue Mar 04, 2014 7:24 pm

Loading local html

Post by roddy » Thu Apr 10, 2014 8:53 pm

Can't get my local html to load.

I've set the default MobGUI URL to [specialFolderPath]/dream/dream.html but nothing shows up in the simulator. There isn't a lot of documentation for us beginners on the specialFolderPath... I'm on LC 6.6.0 and iOS Sim 7.1

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: Loading local html

Post by Simon » Thu Apr 10, 2014 10:00 pm

Hi roddy,
There are only a few specialFolderPath's and they are listed in the dictionary.
You cannot make them up yourself.

You would have your html file in the Copy Files tab of the standalone builder so it's location is specialFolderPath("engine"),if it's just a static page you can leave it there. Otherwise move it to specialFolderPath("documents").

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

roddy
Posts: 40
Joined: Tue Mar 04, 2014 7:24 pm

Re: Loading local html

Post by roddy » Thu Apr 10, 2014 10:18 pm

Hi Simon,

I have my local content "/dream/dream.html" in my documents, home and desktop folders as well as in the folder with my LC stack. I've added the folder in my Copy Files tab in standalone settings.

The MobGUI documentations says:
"Entering the URL [engine]/LocalContent/Index.html would load the local Index.html file from the LocalContent folder included with the app."

I've tried all of the below in the MobGUI default URL field for my browser:
file://[specialFolderPath]/dream/dream.html
file://[documents]/dream/dream.html
file://[engine]/dream/dream.html
file://[home]/dream/dream.html

Roddy

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: Loading local html

Post by Simon » Thu Apr 10, 2014 10:46 pm

Hi Roddy,
You are missing specialFolderPath
it is
("file:" & specialFolderPath("engine") & "/dream/dream.html")

To make it easy to test just copy the file "dream.html" not the entire directory structure.
("file:" & specialFolderPath("engine") & "/dream.html")
Once you get that working then add the folder structure.

In the dictionary it's like this
put url ("file:" & specialFolderPath("engine") & slash & "foo.txt") into tFileContents
that "slash" is the same as "/"

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

roddy
Posts: 40
Joined: Tue Mar 04, 2014 7:24 pm

Re: Loading local html

Post by roddy » Thu Apr 10, 2014 11:12 pm

Can't get it to work. I don't need the start and end quotes for the MobGUI URL field, correct?

file:" & specialFolderPath("engine") & "/dream/dream.html

Is there something else I should have set-up in the MobGUI browser script first?

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: Loading local html

Post by Simon » Fri Apr 11, 2014 12:57 am

Here from the mobgui docs
mobileControlSet "MyBrowser", "url", "file://" & specialFolderPath("engine") & "/HTML/Index.html"

Simon
Edit: mobileControlSet "MyBrowser", "url", "file:" & specialFolderPath("engine") & "/HTML/Index.html"
works as well.
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

roddy
Posts: 40
Joined: Tue Mar 04, 2014 7:24 pm

Re: Loading local html

Post by roddy » Fri Apr 11, 2014 3:12 pm

Thanks for your time on this...

Using the MobGUI plug-in, I didn't think I needed to use any other commands other than the default URL field on the plug-in panel. I'll have to play around with mobileControlSet.

Roddy

Post Reply

Return to “MobGUI”