Create A Snippet


Snippets allows you to save and add individual snippets of JavaScript. This can be anything from a small piece of code to entire JavaScript libraries. Once a Snippet is added, you can add Snippets to Scripts, which can then be added to Blocks.

Learn more in On2Air: Scripts Overview

Learn more about creating Scripts
Learn more about creating Blocks

In this article:

Create a New Snippet
Rename Your Snippet
Edit Your Snippet
Snippet Settings
Version History

Create a New Snippet

Click Snippets on the left-side menu

Click New Snippet

Add your JavaScript code in the text box in the Snippet tab

Click Save Snippet

To enable your Snippet, toggle the Disabled switch to Enabled



Rename Your Snippet

You can rename your snippet by clicking New Snippet in the title field

When you click out of the field, your name will be automatically saved or you can click Save Snippet



Edit Your Snippet

You can edit your Snippet at any time by changing it in the text field

When you are finished changing it, click Save Snippet



Snippet Settings

If you no longer want a script, click Delete Snippet

Verify deletion by clicking Yes, I want to Delete this snippet

WARNING: Deleting a script cannot be undone.



Version History

You can save each version of your Snippet.

To save a Snippet

Under the Snippet tab, enter your Snippet in the text box

Click New Version

Use the automatically filled Version ID or add your own

Add a Description

Click Create New Version

Snippets - Version History

Please note, this will not automatically save each version of your Snippet. You must manually create a new version.

To view Version History

Click the Version History tab

Click the Version you would to view
Was this article helpful?
Cancel
Thank you!