SUMMER SALE - USE DMXSUMMER19 PROMO CODE FOR UP TO 51% OFF. Valid only until July 24th!

Using Dynamic Expressions in JavaScript Functions

Using Dynamic Expressions in JavaScript Functions

Learn how to use App Connect Static Events in order to use dynamic expressions in JS functions

In this movie you will learn how to use dynamic data expressions in JavaScript functions using App Connect Dynamic Events.

Step by Step

We created a repeat region, which displays data from our database. We want to run some custom Javascript code, which needs a dynamic value from the repeat region. This could be any custom function like for example, google analytics code which tracks the clicked ID. We will show an example using a simple alert function which shows the quantity of the selected product. Click the element you want to trigger the function, in our case this is the check button (1). Add a new dynamic event (2). We want to trigger the alert on click so we selected: mouse, click (3-4).

Enter the function in the action field. Just insert the dynamic expression in the function, wrapped in curly brackets.

And we are done! Let's preview the results.

Clicking the check buttons, triggers the alert which displays the products in stock. That's how easy it is to use dynamic expressions in Javascript functions, using App Connect dynamic events.

Comments

Be the first to write a comment

You must me logged in to write a comment.