Welcome, Guest Login

Support Center

EachScape Actions in JavaScript

Last Updated: Nov 01, 2016 04:26PM EDT

EachScape Actions in JavaScript. 


 

Introduction

The EachScape Native JavaScript SDK (ESLib) is a cross-platform set of JavaScript objects and methods that can be used to control an app through reading and writing variables and executing actions in a browserless javascript context.

Using the EachScape Native JavaScript SDK
(ESLib) you can access EachScape Actions in JavaScript.
EachScape Actions give users access to iOS and Android native features: GPS, Camera,...



Concept

ESLib is a native JavaScript SDK used to run EachScape Actions from JavaScript.

ESLib is accessible via the JavaScript Editor.
There are 2 places where users can enter JavaScript using the JS Editor:

  1. When the JS is associated to an Event
  2. Among other EachScape Actions, by using using the action : "JavaScript"


Both will use JavaScript Editor to enter JS in the app.

 

Tutorial App
The JavaScript Tutorial app illustrate the use of ESLib.

Click here to install the JavaScript Tutorial App

All the actions in the Tutorial App are executed in JavaScript 
using the ESLib SDK



Launching JavaScript through an Event

An Event can trigger a JavaScript.

That JavaScript can use ESLib to insert EachScape Actions inside the JS.


When associating an Action(s) to an Event, users can select either

  1. EachScape Action Script
  2. JavaScript
 

 


Choosing JavaScript will associate a JavaScript to that Event.

When selecting the "JavaScript" option the JavaScript Editor is displayed:

In this example, we use JavaScript to parse an EachScape variable v_customerID andt insert some "-" to separate the digits for a better readability.

But most importantly, this JavaScrip uses ESLib.
Specifially to set up a variable using ESLib methor ESLib.setVar

Learn how to use JavaScript Editor to insert EachScape Action in a JavaScript


Launching JavaScript through an Action

The code below is entered under 'Script' in the "JavaScript" Action.
The "JavaScript" action can be called as one of many EachScape Action.


In this example the JavaScript action is called before 3 other actions (Set Container Block, Remove A Layer, Refresh Block) 



Learn how to use JavaScript Editor to insert EachScape Action in a JavaScript
 



Learn More
- EachScape Native JavaScript SDK
JavaScript & HTML5 Overview
- Execute Custom Script from HTML

Help us improve! Rate this article:

Yes I found this article helpful

Ask a Question   

support@eachscape.com
http://assets1.desk.com/
false
eachscape
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete