Rich-text Reply

Safari & Firefox button not working issues

ambervb 12-19-16

Safari & Firefox button not working issues

I am starting a test with a book button on a hotel website. Now When I open it in the browsers safari and firefox multiple times for example 3 times, 1 of the 3 times the booking engine opens and  2 times nothing happends when I click on the button.

 

What could be wrong? I really need some help!

Level 1

robertchan 12-19-16
 

Re: Safari & Firefox button not working issues

 Sounds like you have a timing issue. Try to wrap the code making the button change with something that checks for the button's existence. I've gotten you started with something very basic below:

 

 

var yourButton = $('.your-button-selector');

var changeYourButton = function(){
  if(yourButton == null){
    setTimeout(firstCall, 400, cBack);
  } else {
    // PUT YOUR CHANGES TO THE BUTTON CODE HERE
  }
}

changeYourButton();

To use this, copy and paste it into the Variation Code of the variant where your button is being changed. Take the selector of your button and paste it into the code where it say:

.your-button-selector

Next, copy and paste the code that changes your button into the section that says:

// PUT YOUR CHANGES TO THE BUTTON CODE HERE

You will want to tweek any issues with your developer(s) and also put some console logs in to check on how the code fires for you. 

 

Another thing that might be causing you issues is if your website is a single page application.

 

Robert Chan

Experimentation Hero