Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This lesson explains features of the element and gives an example of using JS for Web Share API in the app.


IMPORTANT NOTES

(1) THE JS SCRIPTS YOU PLACE GO INTO <BODY> 

(2) DO NOT USE TAGS  <script type="text/javascript"> AND </script>, AS THE SCRIPT ELEMENT ITSELF OPENS AND CLOSES THESE TAGS - ONLY PASTE THE CODE ITSELF


Use cases:

You can use JS code to interact/change/modify/update all of platform’s entities, like screen elements, like data points. Use it to achieve ANY result needed for your application. 

...

  • calling Web APIs, for direct access to hardware
  • embedding games or special visual behaviour
  • connecting any JS libraries, for example for charts, online chats, counters, calendars etc etc etc.
  • etc 


Image Added




How to Use Custom JS/HTML


ADD IT TO THE SCREEN


The HTML or JavaScript Element is marked RED, and code inputs, marked ORANGE, located in Properties of the element Custom JS/HTML. 

...

Code Block
languagejs
themeMidnight
MBST = {

platform: (string) 'ios|android',

ht: function (path[, value]),

watch: function (path, callback),

addActionListener: function(name, callback),

component: function (name),

action: function ([index], [actionsList])

}





FULL LIST OF MBST ACCESS FUNCTIONS


Again, at the constructor you use notation #Variable:test#, but in JS: MBST.ht("Variable:test")

...