Question

I have created an experiment on Optimizely and I want to start the experiment. But before starting, I want to test out things how they look.

So I created an experiment and copied code from the text area which they provide via button at the bottom right corner of screen. I saw jQuery code snippet So I am wondering if I have to include jquery as well in my website if I have to actually start the experiment Or do they provide some other alternative too ?

Example:

$('.lh-192 > li:eq(0)').css({'left':'0px', 'position':'relative'});
$('.lh-192 > li:eq(0)').detach().insertBefore('.lh-192 > li:eq(4)');

My question is: Can I run an experiment on optimizely without including jQuery ?

Was it helpful?

Solution

Optimizely is based on jQuery and will use version 1.6.4 to run. By default, Optimizely will include a trimmed version of jQuery (only containing the code that is necessary to run Optimizely), but you can choose to either include the full jQuery lib or have Optimizely use your own jQuery lib (version 1.4.2 or higher).

You can find more detailed instructions on how to do this on our Learning Center: https://help.optimizely.com/hc/en-us/articles/200039655-How-can-I-use-Optimizely-with-my-own-copy-of-jQuery-

You can also find some more detailed explanation of how Optimizely avoids conflicts with existing Javascript libs in global scope on there: https://help.optimizely.com/hc/en-us/articles/200040385-Does-Optimizely-conflict-with-existing-javascript-libraries-like-jQuery-Prototype-or-MooTools-

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top