All Collections
Settings
Settings FAQ
How can I know when the UserGuiding script is loaded, and the JavaScript API is ready?
How can I know when the UserGuiding script is loaded, and the JavaScript API is ready?

Learn how to load the UserGuiding script and access the JavaScript API.

Muhammet avatar
Written by Muhammet
Updated this week

There are a couple of ways to execute your functions when UserGuiding code is loaded. 

The first one is to push an  onload  event to userGuidingLayer as below. We'll execute this command when the UserGuiding application is loaded.

window.userGuidingLayer.push({
  event: 'onload',
  fn: _YOUR_FUNCTION_HERE_,
})


Another one is to set a variable called  onUserGuidingLoad  explicitly to the window.

window.onUserGuidingLoad = _YOUR_FUNCTION_HERE_
Did this answer your question?