Core
Core JavaScript features
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 Block Nameβ
Get the current name of the block.
Errorsβ
Here is a list of errors that can be thrown when calling this function in addition to generic errors:
Error Code | Description |
---|---|
| The 'caption' property is not defined on the block. |
Get Propertyβ
Get a property by name from the current block.
Argumentsβ
Name | Type | Required | Default |
---|---|---|---|
| String | β | - |
Errorsβ
Here is a list of errors that can be thrown when calling this function in addition to generic errors:
Error Code | Description |
---|---|
| The provided |
Get Image Urlβ
Get a public URL of an image, based on the given imageId
.
Image Resizingβ
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.
Basic Exampleβ
Multiple Image sizesβ
It is also possible to use multiple image resolution depending on the device resolution or pixel density using image src sets. Read MDN guide for more information.
Resultβ
Argumentsβ
Name | Type | Required | Default |
---|---|---|---|
| String | β | - |
| { width: Number, height: Number } | - |
Errorsβ
Here is a list of errors that can be thrown when calling this function in addition to generic errors:
Error Code | Description |
---|---|
|
|
Show Loaderβ
Show an overlay with a spinner.
Hide Loaderβ
Hide the loader overlay that was shown by the showLoader
function.
Errorsβ
Here is a list of errors that can be thrown when calling this function in addition to generic errors:
Error Code | Description |
---|---|
| There is no active loader. |
Generic errorsβ
Error Code | Description |
---|---|
| Unknown error occurred. |
| The app failed to respond within the set timeout. |
| The function that was called doesn't exist. |
| The function isn't supported in the current version of the app. |
Last updated