Embedding with JavaScript
Embedding with JavaScript is slightly more complicated and requires two steps:
- Add the JavaScript Source to <head>
- Insert code in the <body> where the element should appear
NOTE: The format of screens is slightly different in Version 3.
Embed Codes Pop-up
Sample
The Metric Insights JavaScript Demo is a little more complex than a simple copy and paste of code. We added a drop box that calls a function so we can easily switch between elements.
JavaScript Source in <head>
function switchElement()
Drop box select_element
Next we created a drop box with a list of Elements. Note that there is an "onChange()" action that calls the "switchElement()" function created above.
JavaScript code in the <body>
This is the code in the body of the page and should look similar to the code you see in the Embed Codes dialog box.