Rich-text Reply

Editing Content that is not available upon page load

teachco 10-29-15

Editing Content that is not available upon page load

I am trying to figure out the best way to edit content that is not available on page load.  We have a checkout funnel and from the beginning of the purchase all the way through the final order confirmation, it is all one page and there are no new page loads.  We want to edit content that appears in the order confirmation part of the page.  There is a div ID that is set to display:none upon page load and then once the content is loaded in to this section, it is set to display:block.  Is there a way to fire code once that element is visisble?  Or what is the best practices to do this kind of a test?

Level 2

JDahlinANF 10-30-15
 

Re: Editing Content that is not available upon page load

Given the length of time that a user would be on the page before the item becomes visisble, you will want to have your DEV team add a trigger than you can listen for.

 

window.$('window').on('triggernameHere',function(){
    //stuff you want to do
})

The .on() method is not part of Optimizely's trimmed 1.6.4 version of jQuery, so if you are not loading a morerecent version, you may want to use .live() instead.