Skip to content

Types of Events in Wized

  1. Custom Condition: This event enables you to establish a specific condition using the Function Editor. The event will activate when the defined condition evaluates to true. You can leverage various data types available in Wized—such as variables, cookies, API responses, or user input values—to construct intricate, customized conditions.

  2. Attribute Present: This event is triggered when Wized identifies an element on the currently selected page that possesses a specific Wized attribute. It is particularly useful for executing actions when a designated component loads or when specific criteria within your page structure are satisfied.

  3. Request Finished: This event occurs immediately after a particular API request concludes, whether successfully or with an error. You can utilize this event to handle the API response, update the user interface, or carry out additional actions based on the result of the request.

  4. Page Starts Loading: This event takes place when the page begins to load in the user's browser. It is optimal for initializing variables, retrieving data from APIs, or executing other preparatory tasks prior to the page becoming visible to the user.

  5. Page Finishes Loading: This event is activated when the page has completely loaded in the user's browser. You can use this moment to perform final checks, reveal elements that were hidden during the loading phase, or initiate animations and transitions.

When to use Page Starts Loading vs. Page Finishes Loading?

The answer depends on when you need those actions to take place and what impact they will have on the user experience.

  • Page Starts Loading: This event is triggered the moment the page begins to load, even before the user sees anything on their screen. It is ideal for:

    • Early actions: Tasks that need to be performed as soon as possible, such as displaying a loading indicator or initializing critical variables that are necessary for the page load.
    • Fetch data early: Making requests to APIs or databases to have the information ready when the user needs to interact with the page.
  • Page Finishes Loading: This event is fired once all elements of the page have loaded and are ready for use. It is perfect for:

    • Content-dependent interactions: If you need to manipulate specific elements on the page, perform animations, or apply logic that requires all content to be present, now is the time to do it.
    • Final Checks and Validations: Performing security checks, validating forms, or verifying the user's authentication status after the page has fully loaded.
    • Optimize performance: If you have tasks that may slow down the initial loading of the page, such as loading images or heavy scripts, execute them at the end of the page load to improve the user experience.