Reset JS
How to use the Reset JS code section of the Template Builder for Optimizely Web Experimentation and Optimizely Personalization
Use Reset JS to "clean up" after an experience template in Optimizely Web Experimentation and Optimizely Personalization. Use it in the editor when changing field values or removing an existing template. Reset JS should remove the element and any other side effects.
One way to write reset JS is to use the extension.$instance
value. For example, you could create a template with HTML.
<div class="banner" data-extension-instance="{{extension.$instance}}">
You can then remove it using Reset JS.
$("[data-extension-instance=" + extension.$instance + "]").remove();
Updated 16 days ago