Rich-text Reply

jQuery is not defined error

whittl 01-05-15

jQuery is not defined error

Account is set to include a trimmed-down (recommended) version of jquery, yet optimizely throws this error in developer console on line 26 of 230680013.js

 

This prevents all experiments from running.

 

The docs mention including jquery before optimizely in the head but we use requirejs for most of our libraries (optimizely excluded) and doing that causes conflicts with jquery libraries.

 

Expected behavior is that having optimizely include jquery means that this error would not be thrown because optimizely would have its own version of jquery that does not conflict with our version.

 

Here's a temporary test environment link:
http://goo.gl/iEFn60

Level 1

MartijnSch 01-06-15
 

Re: jQuery is not defined error

I think the test environment is not available anymore, but I also think that you gave the answer already yourself that jQuery isn't loaded correctly.

Re: jQuery is not defined error

Hi @whittl,

 

Optimizely does run the noConflict() method within our version of jQuery, such that you can use any other library without issue.  The only requirement from an Optimizely perspective is that jQuery be available to Optimizely so we can function correctly; it doesn't matter if we use our own library or your site loads its own above our snippet.

 

I did load your paused Storefront experiment successfulyl in the editor, and the visual changes you've made there are straightforward enough that I wouldn't expect any errors.  Further, I did not see any console errors when I went to the page directly in a separate browser tab.

 

The only thing I did notice was that Optimizely was not installed on that page.  This would be the first step for us trying to recreate the issue.  If you like, you can provide more details to our Support team here.

Harrison Krat
Solutions Architect | Optimizely, Inc.
harrison@optimizely.com