Documentation‎ > ‎JavaScript‎ > ‎

JavaScript API

Tiggzi with a small JavaScript library to make it working directly with components in JavaScript. 

You can see the API here. (Note: the API will soon be updated to Tiggzi but the old Tiggr name will still work). 

One of the most useful methods is finding a component using Tiggr('id') method. 

For example, let's say we have the following mobile UI;

On button click, we would like to read the value entered in the input field. 

  1. Add a click event to the button
  2. Add Run Custom JavaScript action to the click event. 
  3. Run custom JavaScript looks like this: 

    var input = Tiggr('input');
    alert (input.val());

  4. The app looks like this when running: 

What we showed above is easy and quick way to get access to any component in the screen. It's equivalent to using jQuery directly:

var input = $('input[dsid="input"]');
alert (input.val());

Once you get a reference to the element, you can use any jQuery API to manipulate the element. It's plain JavaScript and jQuery - nothing else!

Every component in Tiggzi has a name property, the name property is used to set the dsid attribute.