OnClose and OnComplete are fields found in the module settings for selected modules under the Developer section. To access this section, select a module that you have added to your page followed by the Settings palette.

They allow tasks to be performed using JavaScript Commands.

  • What is OnClose?
    This type of command will run when the module is closed down by the user:
    - closing the pop-up (by selecting the cross from the top right corner)
    - completing a task that closes the pop-up (for example - a quiz).
  • What is OnComplete?
    This type of command is similar, however, it will only run after the module has completed its task, not if it is closed before (for example - viewing an in-page video).

Example
You may have a pop-up video, which contains key information that your readers must know.

  • OnClose
    If the video is closed before it has finished playing, a More Information Popup could be triggered to warn the reader that the content of the video is important and they must watch it.
  1. Add a More Information Popup module off-page, select Settings and copy the JS Command
  2. Select your video module, select Settings and paste the JS Command into the OnClose field
  3. The More Information Popup will be triggered when the video is closed.
  • OnComplete
    On completion of the video (i.e. the video has played to the end), a survey module could be triggered to collect feedback.
  1. Add a survey module off-page, select Settings and copy the JS Command
  2. Select your video module, select Settings and paste the JS Command into the OnComplete field
  3. The survey will be triggered when the video is complete.

Both of these fields expect to receive JavaScript commands, not web links or URLs. Every module has a Module JavaScript Command field containing the command, and advanced users can even write their own. For more on how to link modules together in this way, see the linking modules article.

Modules that support these fields are:

Learn more about what commands are available in the PageTiger JavaScript API.

Did this answer your question?