Starting from version 8, livecode can export a software to an HTML5 version of it. This means that you can upload your software on a website and it works as a Javascript page.
In order to do so, just select HTML5 exportation in the standalone application settings, then you should obtain a folder containing:
- an example HTML file
- a MEM file
- a JS file
- a ZIP file
except the HTML, all other files are required to run your app in the browser.
You can use the HTML file provided from livecode, as HTML page for the app; otherwise you can incorporate the app in your webpage. This is the code to incorporate your app, correct the JS example filename with your JS filename:
< canvas style="border: 0px none;" id="canvas" oncontextmenu="event.preventDefault() </canvas> < script type="text/javascript"> var Module = { canvas: document.getElementById('canvas') }; </script> < script async type="text/javascript" src="standalone-community-8.0.1-rc-1.js"></script>
Javascript[]
It is now possible to call JavaScript code from HTML5 standalones by using the
do <script> as <alternateLanguage> form of the do command.
This allows HTML5 standalones to interact with the browser within which they are running. Thevalue of the JavaScript expression will be placed in the result variable:
local tDocTitle do "document.title" as "JavaScript" put the result into tDocTitle
Microsoft server[]
Micorsoft server doesn't show pages with unknown extension, so you need to configure it adding the MIME type ".mem". You can set it as "application/emscriptem".