Delay in buttons in test mode Answered

Post author
Milan null

Hello,
I’m experiencing an issue with buttons in Memberstack. On my Webflow site, buttons connected to Memberstack are not clickable until a few seconds after the page loads. I’m using test mode, and I noticed this might be related to asynchronous script loading or the initialization of Memberstack. Could you help me figure out why this is happening and how I can speed up the button loading? You can check: https://confident-861463.webflow.io/login

Comments

1 comment

  • Comment author
    Chukwudi Onyekwere
    • Edited
    • Official comment

    Hi Milan,

    I’ve reviewed your source code and noticed that the installation script is placed within the body:

    <script data-memberstack-app="app_cm6z91iez000i0srt84ybg5zc" src="https://static.memberstack.com/scripts/v1/memberstack.js" type="text/javascript"></script>

    For optimal placement, it should be moved to the <head></head> section instead. Once that’s done, you can safely remove the following code block from the head, as it will no longer be needed:

    <script>
    var url = window.location.href;

    var targetDomain = "webflow.io";

    var memberstackAppId = "app_cm6z91iez000i0srt84ybg5zc";

    if (url.includes(targetDomain)) {

    var script = document.createElement("script");

    script.setAttribute("type", "text/javascript");

    script.setAttribute("data-memberstack-app", memberstackAppId);

    script.src = "https://static.memberstack.com/scripts/v1/memberstack.js";

    document.head.appendChild(script);

    }
    </script>


    I hope this helps.

Please sign in to leave a comment.