Skip to content
  • back
  • Glasshouse help

  • Glasshouse help
  • How Glasshouse is organised
    • Page types
    • Tabs
  • The basics
    • Creating pages
    • Adding and formatting content
    • Adding images
    • Managing files
    • Adding and managing users
    • Managing pages
  • Building learning sequences
    • Adding a sequence page
    • Adding a basic content block
    • Block types
      • Assignment block
      • Branching scenarios
      • Button
      • Cloze tests
      • Complex Feedback
      • Drag and Drop
      • xAPI forms
      • xAPI form display
      • Hotspot
      • Layout blocks
      • MCQ Buttons
      • MCQ - Drop down
      • MCQ - Range Slider
      • Short answer
      • Tables
      • Wiki
      • Sticky blocks
    • Front end editing
    • Adding media
    • Adding pop-ups
      • Adding blocks to pop-ups
    • Adding navigation
    • Completion Setting
  • Integration and export
    • Export SCORM
    • Adding a completion button
    • Setting up an LTI Integration
    • Single Sign On
    • Launch other sites
    • Export content in a simplified version
  • Other things you can do
    • Content curation with Glasshouse
    • Building spaced learning
    • Building interactive videos
    • Building an assessment
    • Building a handbook
    • Setting up a registrations page
      • Adding custom fields
    • Changing the visual design
      • Changing the login page
      • Changing site and page logos
      • Changing the navigation style
    • Building a dashboard
    • Certificates
    • Building workflows
    • Adding managers and buddies
    • Javascript actions
    • Shortcode
    • Using Glasshouse as a lite Learning Management System (LMS)
    • Restricted Navigation
    • Checklist
    • Group Rules
    • Text to Speech
    • Assignment Feature
    • Snippets

Javascript actions

Overview

Javascript actions can be created to trigger specific actions based on user behaviour. Trigger events include page load, clicks, countdowns, trigger opened and slide shown. The javascript actions themselves are pre-configured, and contain multiple further customisation options. Multiple javascript actions with varying triggers/actions can be implemented on a single page.

How to create javascript actions

Start in the Javascript actions tab in the Page management area of the page to which the javascript action will be added.

  1. Click the Add Javascript Action button.
  2. Enter a name for the javascript action into the Label field. This label will be used to identify the javascript action in the back-end only, and will not be visible on the front-end webpage.
  3. Select the desired trigger action from the Event that will trigger this action dropdown menu.
  4. Select an action to trigger from the Action dropdown menu.
  5. Click Save.
  6. Depending on which specific action has been chosen, further options will be available after saving. Some actions will require a target selector, or element ID to be entered.
Options

If a trigger option such as page onload has been selected, the Selector/Name of the object that is the trigger field can be left blank, as the page loading will trigger the javascript action. If a trigger such as click has been selected however, an ID of the object which is to be clicked must be entered into this field.