Core
Core JavaScript features
Last updated
Was this helpful?
Core JavaScript features
Last updated
Was this helpful?
Integrate your JavaScript code with the basic functions of your AppMachine app. This page discusses the available functions and possible errors that lie at the basis of each JavaScript block.
Get the current name of the block.
Here is a list of errors that can be thrown when calling this function in addition to :
INVALID_ARGUMENT
The 'caption' property is not defined on the block.
Get a property by name from the current block.
propertyName
String
โ
-
INVALID_ARGUMENT
The provided propertyName
is not found.
Get a public URL of an image, based on the given imageId
.
By default the image URL that will be returned is the URL of the image in full resolution. We recommend using fixed dimensions for the width
and height
options when using high resolution images. This also improves performance and saves bandwidth.
imageId
String
โ
-
dimensions
{ width: Number, height: Number }
-
INVALID_ARGUMENT
imageId
is missing or the width
or height
isn't a number.
Show an overlay with a spinner.
Hide the loader overlay that was shown by the showLoader
function.
OPERATION_NOT_ALLOWED
There is no active loader.
UNKNOWN_ERROR
Unknown error occurred.
TIMEOUT_EXCEEDED
The app failed to respond within the set timeout.
UNKNOWN_FUNCTION
The function that was called doesn't exist.
VERSION_NOT_SUPPORTED
The function isn't supported in the current version of the app.
Here is a list of errors that can be thrown when calling this function in addition to :
It is also possible to use multiple image resolution depending on the device resolution or pixel density using image src sets. Read for more information.
Here is a list of errors that can be thrown when calling this function in addition to :
Here is a list of errors that can be thrown when calling this function in addition to :