Page 1 of 1

HTML5 on Microsoft server [solved]

Posted: Mon Jun 06, 2016 9:37 am
by MaxV
Hi,
I have a friend that tried an HTML5 app, but it works on Linux server, not on Microsoft server.
What is the configuration needed on a microsfot server to run livecode HTML5 app?

Re: HTML5 on Microsoft server

Posted: Mon Jun 06, 2016 10:39 am
by malte
Did you serve it via a Webserver, or did you use a file URL to check?

If I am not mistaken you will have to have a Webserver (most likely IIS on Win, maybe apache) running on the server and put your HTML5 ab in the folder that is configured to serve the sites. Then you will need to point the browser to the correct HTTP(S) URL to your Webapp.

Hope this helps,

Malte

Re: HTML5 on Microsoft server

Posted: Mon Jun 06, 2016 12:11 pm
by [-hh]
To my knowledge this is completely independent of the server (if there are no size limits for the single files to serve!!).
The only dependency is the browser used:
HTML5 standalones are NOT displayable by any Microsoft browser. Newest Chrome, Firefox, Opera and Safari are OK.

Re: HTML5 on Microsoft server

Posted: Tue Jun 07, 2016 10:31 am
by MaxV
No,
this doesn't work on IIS server, but works on Linux server:
http://www.fenixsoftware.it/EsempioHTML ... d%201.html

I suspect that IIS needs some configuration.

Re: HTML5 on Microsoft server

Posted: Tue Jun 07, 2016 12:31 pm
by [-hh]
Three ideas, just to find out the culprit.
Please try one after the other, may be the first or the second already helps.

[1] Remove the space from the filename
(which is generated by the project name: Use "untitled1, not "untitled 1")
[2] Open the html file with a text editor and replace lines 226 to 229 by

Code: Select all

<script async type="text/javascript" src="standalone-community-8.0.1-rc-1.js"></script>
</body>
</html>
[3] Try to generate the standalone with 8.0.0-dp15.

If none of the three helps, then please come back.
[Edit. One server-sided possibility: Older servers don't support "async" loading. You could check that for your server version --- or try in step 2 without the word "async"].

Re: HTML5 on Microsoft server

Posted: Wed Jun 08, 2016 12:37 am
by MaxV
No, nothing works... :?:

Re: HTML5 on Microsoft server

Posted: Wed Jun 08, 2016 8:38 am
by [-hh]
Next idea.
Make a standalone from a stack "maxvtest.livecode", containing nothing than a standard button. Rename "standalone.zip" to "maxvtest.zip".
Put the following into a UTF8 file "maxvtest.html", it is a 'naked' minimal calling HTML.
Put this file in the folder of the standalone.
Now you have a folder "maxvtest" containing

standalone-community-8.0.1-rc-1.js
standalone-community-8.0.1-rc-1.html.mem
maxvtest.zip
maxvtest.html

load http://<your server>/maxvtest/maxvtest.html

with exactly the same browser and OS from both the WinServer and the LinuxServer.

If both works, then the original problem is caused by the standalone and we have to investigate there.
If it works from Linux only then it's the WinServer and I have no further idea.

Code: Select all

<!DOCTYPE html>
<html lang="en"> <head> <meta charset="utf-8"> <title>Max V's tests</title> </head>
<body> <div>
<canvas id="canvas" oncontextmenu= "event.preventDefault()" style="outline:none;"></canvas>
<script type="text/javascript">
var Module = {canvas: document.getElementById('canvas')};
Module.livecodeStandalone = "maxvtest.zip";
</script>
<!-- one may also try without "async" for older server -->
<script async type="text/javascript" src="standalone-community-8.0.1-rc-1.js"></script>
</div> </body> </html>

Re: HTML5 on Microsoft server

Posted: Wed Jun 08, 2016 10:28 am
by MaxV
It doesn't work on IIS server 7.5. I get:
Exception thrown, see JavaScript console.
An the console reports:

Code: Select all

run() called, but dependencies remain, so not running
Failed to load resource: the server responded with a status of 404 (Not Found)
Uncaught could not load memory initializer standalone-community-8.0.0.html.mem
Failed to load resource: the server responded with a status of 404 (Not Found)
still waiting on run dependencies:
dependency: memory initializer
dependency: al standalone-community-8.0.0.html.mem
(end of list)
So I suppose that IIS server must be configured for javascript... I never put my hand before on a IIS server, so I don't know what to do.
Probably it doesn't serve mem file, if it isn't configure properly.

Re: HTML5 on Microsoft server

Posted: Wed Jun 08, 2016 10:40 am
by [-hh]
I wonder why it is looking (not finding) for .. 8.0.0.html.mem?
Everything must be called exactly with the version, that produced the standalone:
Is there a bug in the version naming?

Please check: this should be in the folder
standalone-community-8.0.0.js
standalone-community-8.0.0.html.mem

and in the html file near the end
<script async type="text/javascript" src="standalone-community-8.0.0.js">

Re: HTML5 on Microsoft server

Posted: Wed Jun 08, 2016 2:46 pm
by MaxV
No, it doesn't serve the MEM file.
Look at the error if I try to go directly to MEM file:

Code: Select all

Server Error in Application "<application name>"
--------------------------------------------------------------------------------
HTTP Error 404.3 - Not Found
HRESULT: 0x80070032
Description of HRESULT: The page you are requesting cannot be served because of the Multipurpose Internet Mail Extensions (MIME) map policy that is configured on the Web server. The page you requested has a file name extension that is not recognized, and is not allowed.
http://go.microsoft.com/fwlink/?LinkID= ... 70032,7601

Re: HTML5 on Microsoft server [solved]

Posted: Wed Jun 08, 2016 3:00 pm
by MaxV
I solved on my local Microsoft server adding the MIME type MEM as: application/emscriptem