JavaScript not being indexed

Hello. I am having issues with the theme not applying my JavaScript code. Upon testing it in the console on the corresponding page, it works perfectly. Upon applying it in Theme Options > Custom JS, it seems to not even index it.
Please advise further on how should this be resolved. Regards, Ioan

Comments

  • Hi, we do not know what custom JS are you inserting to your custom JS but we can assure that it works fine. How can it be not indexing when it is in the page code?
    thanks
  • var dollarSing = document.querySelectorAll('p#wrdpress_pkg>span');
    for(i = 0; i < dollarSing.length; i++) {
    dollarSing[i].style.display = "none";
    }

    var dollarTwo = document.querySelectorAll('.price>span');

    for(i = 0; i< dollarTwo.length; i++){
    dollarTwo[i].style.display = "none";
    }

    var couponBox = document.querySelector('.reo-coupon-box');
    var formSubmit = document.querySelector('.submit-opts-form');
    couponBox.appendChild(formSubmit);


    As you can see, it is perfectly valid JavaScript and DOM manipulation.
    Upon pasting this code in the console, it works perfectly. The moment it is applied in Custom JS, it is as it was never written. You can see for yourselves on this page: https://thewebprestige.com/reach-us/

    If needed I will cooperate further, but has to be resolved in one way or another.
  • Theme is adding the custom JS correctly: https://pasteboard.co/GXefbVu.png
    The problem is that you have erros in your code: https://pasteboard.co/GXefT2b.png
Sign In or Register to comment.
This website uses cookies

We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services.

Cookies are small text files that can be used by websites to make a user's experience more efficient.

The law states that we can store cookies on your device if they are strictly necessary for the operation of this site. For all other types of cookies we need your permission. This means that cookies which are categorized as necessary, are processed based on GDPR Art. 6 (1) (f). All other cookies, meaning those from the categories preferences and marketing, are processed based on GDPR Art. 6 (1) (a) GDPR.

This site uses different types of cookies. Some cookies are placed by third party services that appear on our pages.

You can at any time change or withdraw your consent from the Cookie Declaration on our website.

Learn more about who we are, how you can contact us and how we process personal data in our Privacy Policy.

Please state your consent ID and date when you contact us regarding your consent.