Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / [SOLVED] OpenBrowser: launch local html file

Author
Message
Bethleem
9
Years of Service
User Offline
Joined: 3rd Oct 2015
Location:
Posted: 3rd May 2019 12:32
Hi.

I´m trying to launch an html file located in the project folder, name it "index.html". Si, if I call OpenBrowser("index.html") it launchs a blank page.
Is there a way to launch local html files?
And if so, would they be packed into some way into the executable?

Thank you.

Belén

The author of this post has marked a post as an answer.

Go to answer

Bengismo
7
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 3rd May 2019 13:04
This post has been marked by the post author as the answer.
You have to give a full path to the local file you want to open. If your html file is in your media directory you would use

OpenBrowser(GetReadPath()+"media/index.html")


There's no easy way to pack the html it into the executable. You could write the html file to the disk from code (opentowrite()) as your exe runs but its easier to just have the file in the media directory or a subdirectory of it.
Bethleem
9
Years of Service
User Offline
Joined: 3rd Oct 2015
Location:
Posted: 3rd May 2019 14:15
Thx so much! It works like a charm. And also thank you for the opentowrite() tip, it´s just perfect for what I intend to do.

Belén

Login to post a reply

Server time is: 2024-11-22 21:25:48
Your offset time is: 2024-11-22 21:25:48