turnOn Tutorial
Learn how to execute JavaScript functions using the 2sxc turnOn. Extend basic usage by passing data, awaiting conditions and more.
This page activates turnOn and executes a JavaScript function using turnOn.
In this tutorial you'll learn how to:
- Activate turnOn using the PageService
- Execute a JavaScript function on initial loading
⬇️ Result | Source ➡️
In this page turnOn passes parameters to a JavaScript function. The passed parameters then get deconstructed and used for DOM manipulation.
In this tutorial you'll learn how to:
- Pass parameters to JavaScript functions using turnOn.
- Deconstruct passed parameters
⬇️ Result | Source ➡️
This page creates a unique DOM attribute and sets it on a div. turnOn then passes this attribute to a JavaScript function, which identifies the element with a queryselector and performs DOM manipulations.
In this tutorial you'll learn how to:
- Create a unique DOM attribute
- Pass it to a JavaScript function
⬇️ Result | Source ➡️
This page creates a anonymous object and sets it on a div. turnOn then passes this attribute to a JavaScript function, which identifies the element with a queryselector and performs DOM manipulations.
In this tutorial you'll learn how to:
- Create a anonymous object in c#
- Pass it's data to a JavaScript function
⬇️ Result | Source ➡️
This waits for a thirdparty library to finish loading, then executes a JavaScript function with turnOn and passes a domAttribute as parameter. The executed JavaScript then triggers thirdparty library code, which modifies the DOM element in the page that causes an animation.
In this tutorial you'll learn how to:
- Include an external library
- Execute a JavaScript function after the library has finished loading
⬇️ Result | Source ➡️
This waits for a function to return true, then executes a JavaScript function with turnOn and passes a domAttribute as parameter. The executed JavaScript then triggers thirdparty library code, which modifies the DOM element in the page that causes an animation.
In this tutorial you'll learn how to:
- Execute a JavaScript function after a custom condition was met
⬇️ Result | Source ➡️
This page waits for a system script to load, then executes a JavaScript function with turnOn and passes a domAttribute as parameter. The executed JavaScript then triggers a system script, which binds the fancybox properties.
In this tutorial you'll learn how to:
- Execute a JavaScript function after a system script was loaded