Example of running a custom javascript function when a page contains a certain pageData variable

I am trying to trigger a bootstrap modal to pop up when a page contains a certain pageData element.
Similar to the example shown in the Experience View tutorial except instead of showing a bootstrap warning or success element… Like This:
image

I want to show a modal which keeps the user from committing any actions after they submit a form until the countdown is up (gateway has had time to scan the devices and respond to losant with an update of live sensors).
[https://codepen.io/machinesaver/pen/vomGJN](http://Code Pen Example)
image

Are there any examples of how to trigger a custom JS script after submitting a form or even something similar showing implementation of custom javascript around the losant Forums?

Hi Leo,

You will need to make an AJAX request to an Experience Endpoint and do your work in JQuery, a good example can be found on this forum post. You could either do the waiting with JQuery, or you could route to an intermittent waiting page, which would depend on your use case and preferences.

Let me know if I can answer any questions!
Julia

1 Like