Probably too much for a single developer. But I will try to continue. Here are some tips for PHP:
Php scripts have a ton of new features. Probably more than i can document in a short time, like when making a forum post.
There are now CLIENT FUNCTIONS, which get converted to Javascript and embedded in the output of FORMOUT().
This means it converts regular functions to PHP and also converts CLIENT functions to Javascript in the same step.
This, of course has some implications, some of the features intended for PHP would be generated also for javascript, but
we have something for it too. Suppose you want to have a small portion of HTML code that you want to include in a javascript,
but it is never used in the PHP part of the generated code, then you can do this:
Code:
#FORM CLIENT SomeCode, "somecode.html"
Code:
#FORM SERVER SomeCode, "somecode.html"
Code:
#FORM SomeCode, "somecode.html"
would contain the fields of a submitted form, while for the JavaScript would contain the fields of a form that has not been submitted yet.
There will be some cases in which you will want to use direct Javascript, so, RAW sections can be used in those cases, it is very simple to do so, for
example, you can embed an mp3 sound file for your Javascript generated code like this:
Code:
#FILE CLIENT Ding, "ding.mp3"
Code:
CLIENT FUNCTION Play(BYREF s AS STRING) AS LONG BEGIN RAW try { s[0].currentTime = 0; s[0].play(); } catch (error) { var b64 = btoa(s[0]); s[0] = document.createElement("audio"); s[0].src = "data:audio/mp3;base64," + b64; s[0].type = "audio/mpeg"; s[0].play(); } END RAW END FUNCTION
Code:
Ding.Play
Code:
Play(Ding)
like a mouseclick or a keypress. This is only a function example, every file embedded file bloats the javascript code. Loading an external
file would be more eficcient.
Ill try to keep posting more undocumented tips.
Comment