Load JavaScript Files

Click-to-Chat supports options for loading JavaScript files (like app.js): Normal, Async, or Defer. Since version 4.27, frontend scripts load in Defer mode by default, but we can now switch to Normal or Async.

How to Change JavaScript Loading

  • Navigate to Click-to-Chat Other Settings.

  • Scroll to Debug & Troubleshoot Section
  • Expand the JavaScript section.

Select the loading type: Normal, Async, or Defer.

1. Normal

  • The script loads and executes immediately where it appears in the page.
  • The browser waits for the script to finish before continuing to render the page.

2. Async

  • The script downloads while the page continues rendering.
  • It executes as soon as it is downloaded, which may be before or after other scripts finish.

3. Defer

  • The script downloads while the page continues rendering, but executes only after the HTML is fully parsed.
  • Scripts are executed in the order they appear in the page.
  • This type was recommended for better experience

Script Execution Sequence

Selecting the loading type determines how Click-to-Chat’s JavaScript files are loaded and executed on our website. This ensures scripts run in the intended order while the page renders smoothly.