Tutorial: Getting Started

Getting Started

The framework can either be included directly into the HTML page via a <script> tag or used as an AMD/Require.js module. The following sections cover both setups.

There are no external dependencies.

Non-AMD (script tag) setup

(If you do not know what AMD is, this section is probably for you.)

To use the tag editor framework in non-AMD context, include the red-dingo-tag-preview-framework.js file in a <script> tag on the web page.

<script src="red-dingo-tag-preview-framework.js"></script>

After that, the TagPreview module becomes available as the TagPreview root object (that is, window.TagPreview).

AMD setup

For AMD/Require.js, red-dingo-tag-preview-framework.js can be used as a module in a define statement:

define(["red-dingo-tag-preview-framework"], function(TagPreview) {
    <user code goes here>;
});

When used this way, the TagPreview module does not pollute the global namespace, so it is not available as window.TagPreview.

After setting up

Once the script has been included on your web page, you can use it in your own JavaScript code. For instructions on adding a tag view on the web page, see Creating a Tag View.