Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

329
Views
Why do I have to use conditional when using JS in VWO?

I'm doing an A/B test, but I noticed that I have to change everything via JS, I just don't understand why I can't just use something like this:

document.getElementById("myDIV").style.background = "url('smiley.gif')

Here is an example of a code used in VWO with JS

  function colpromo() {
      if (typeof (catalogpageloaded) == 'undefined') {
        window.catalogpageloaded = 'loaded';
        // javascript changes here
        /*Eliminating content*/
        const BANNER = document.querySelector(".col-promo-with-cta-module");
        BANNER.remove();
        const HERO = document.querySelector(".hero-content .hero-content-wrapper ");
        const HERO_CHILDREN = Array.from(HERO.children);
        HERO_CHILDREN[2].remove();
        HERO_CHILDREN[3].remove();

Is there any documentation on how to use JS to do an A/B test?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can try firing your JS code on console of dev tools and see if it gives you the desired output. If yes, it should work fine via VWO code editor as well. Extra code will not be needed then.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!