• Resolved revixi5

    (@revixi5)


    Do you know why my javacript doesn’t trigger when i add it to the header of my page? It appear normaly in the source code and work in a local environment (or in a html environement), by in my server with WordPress it’s block by something. Thanks for your help.

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
    <script type="text/javascript">
    $(document).ready(function(){$('#click').click(function(){
    window.location.;});
    setTimeout(function(){$('#click').trigger('click');}, 2000);});</script>
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support 99robotsteam

    (@99robotsteam)

    Hi @revixi5,

    We just tested your script on a demo WordPress site, and it worked as expected (redirecting after 2 seconds or when clicking an element with?id="click"). This suggests the code itself is valid, but WordPress-specific factors might be interfering on your end. Common WordPress-specific issues include:

    1. jQuery Conflict: WordPress uses jQuery instead of $. Update your code to:
      javascript jQuery(document).ready(function($) { // Your code here });
    2. Missing Element: Ensure a #click element exists (e.g., <button id="click">Redirect</button>).
    3. Plugin/Theme Conflicts: Deactivate plugins temporarily or switch themes to test for conflicts.
    4. Caching/Script Order: Clear caches and ensure jQuery loads before your script.

    We recommend sharing these points with your developer for targeted troubleshooting. If issues persist, provide a page link and browser console errors.

    • This reply was modified 1 month, 1 week ago by 99robotsteam.
    Thread Starter revixi5

    (@revixi5)

    Oh my God! Thanks a lot for your help. It’s working perfectly now.

    Plugin Support 99robotsteam

    (@99robotsteam)

    Hi @revixi5 ,

    We’re glad we could help.

    If you’re enjoying our plugin, we’d really appreciate it if you could take a moment to leave us a review. Your feedback helps us improve and lets others know about your experience.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.