Skip to content

Instantly share code, notes, and snippets.

@circAssimilate
circAssimilate / Optimizely Poll For Delayed Content
Last active February 29, 2016 19:10
The pollForDelayedContent() helper function is an alternative solution to some of the approaches listed here: https://help.optimizely.com/hc/en-us/articles/200457495. Look below for more info.
/**
* OPTIMIZELY POLL FOR DELAYED CONTENT:
*
* The pollForDelayedContent() helper function is an alternative solution to some of the approaches listed here: https://help.optimizely.com/hc/en-us/articles/200457495.
* It will be able to be used as many times as it's needed within an experiment or variation. When the Optimizely snippet is implemented correctly, it should provide a way to eliminate all content flashing.
* The function allows for a an "options" element, to allow for more flexibility as well.
* Feel free to file a ticket at optimizely.com/support with any feedback or questions - as the comments on this page will not be responded to.
*
* SIMPLE USAGE EXAMPLE: this does not use the optional options object to specify selectorToHide, timeoutInSeconds, or intervalInMilliseconds, causing them to default to hide the no timeout and 50 milliseconds.
*