Writing your own components

You can add browser-based JavaScript to enhance your applications.

For security reasons, Metrici does not let you output scripts using the normal server-based content output methods – if you add <script> or anything like it, then content will be removed. To include browser-based JavaScript, you must add classes to which your JavaScript responds (using the principle of progressive enhancement) and then use a theme to include your JavaScript as appropriate.

Your scripts can assume the presence of the following industry-standard components:

  • jQuery
  • Bootstrap 3 CSS and JavaScript

The following global variables are generated on each Metrici page.

rootPath Path to the current Metrici page, for example https://www.metrici.com/
nodeVersionReference Node version reference of the node behind the current page.