website on a canvas?

Monkey Forums/Monkey Programming/website on a canvas?

slenkar(Posted 2012) [#1]
Hey you know how people are always complaining about how websites look different on IE?

Well you could design a website in monkey to run on the html5 canvas.

Older browsers can fall back to flash.

To save system resources simply only render and clear the screen when something is pressed (unless you want an active animation on the screen of course).

The only obstacle is interacting with a MySQL database.


The autofit module could be used to scale the website to different displays. All is needed is way to get the screen resolution of the device and go from there.


GC-Martijn(Posted 2012) [#2]
Its possible, but you will miss mysql or other database connections.
And I think its more work (hours) then yust ignore older browsers.


Paul - Taiphoz(Posted 2012) [#3]
Pass any database queries to a php file and let it handle the query, once the results are in have the php file output to a text file, have your html5 canvas pull the text file and parse for the data.

all your vital database passwords and stuff would be secure in your php file and not exposed at any time via the html5 source.

Its not an ideal solution but it would work.


slenkar(Posted 2012) [#4]
yes good idea, haxe could be used for the php side of things.

XMLHttpRequest is used to communicate, the only issue is that I think I heard XMLHttpRequest acts differently on certain browsers, but thats only 1 compatibility issue instead of several.


Paul - Taiphoz(Posted 2012) [#5]
Your real issue will be one of timing, or checking to see if the buffer text file has been written or not as some sql queries might take longer than others you cant simply wait a fixed period of time.

What you might try is adding a #tag at the end of the file, then when you open it with html5, check the string for the tag, if it exists you know you have the full uncorrupted file, if not wait a second and reload.


slenkar(Posted 2012) [#6]
with XMLHttpRequest there is no need for text files, you just get the text messages from the server. Monkey doesnt support this command so the person making the website will have to wrap this command, which doesnt sound difficult.