Contents
Introduction
In Tiggzi, you always start with a mobile web app. That means you can use any JavaScritp in your app. Any 3rd party libraries or any JavaScript you developed yourself.
Adding JavaScript library to your app
There are a number of ways to add JavaScript file (libraries) to your app:
Adding new JavaScript file
- Project View > Create New > JavaScript. Enter JavaScript file name
- Select if you want:
- Create a blank JavaScript file
- Load a file from a URL. In this case, the content of the URL will be copied to this file
- Upload a file from your machine
Loading an external JavaScript library
- Project View > Project > App settings > External resources
- Enter the URL of the JavaScript file you want to load. In this case, you are simply creating a link to a remote JavaScript file
Using JavaScript
No matter which way the file is loaded, the JavaScript library will be available on every page in your app. For example, if there is a function called foo() in the JavaScript that you loaded, anywhere in the app you can call the function by simply entering foo().
Using “Run JavaScript” action
Another option is to run any custom JavaScript by using Run JavaScript action.
You can easily reference any JavaScript function in this action. For example, let’s say you created (or loaded) a JavaScript file with function called foo(). Then, to invoke the function in this action would look like this: