Page specific JS code didn't work...had to insert in global JS

First i’ll admit I don’t know much about JS, but my understanding is that if I only have JS on 1 page, I should be able to use the page JS? However it didn’t work for me. I had to use the global JS to get it to work.

This is was I inserted in global JS:

Hi Philip,

Did you forgot to add the JS code? Please try to add it on the page JS and then share the page URL so we can check. We cannot fixed the issue but we can point you to the possible cause of the error. Thank you.

The javascript code is <script src="//static.leadpages.net/leadboxes/current/embed.js" async defer></script> <button data-leadbox-popup="4iGHACuXkrJEt6CcbfRiA3" data-leadbox-domain="austinstoneworship.lpages.co" style="background: #32C88C;border-color: #32C88C;border-radius: 20px;color: #FFFFFF;display: inline-block;vertical-align: middle;padding: 16px 32px;min-width: 192px;border: 1px solid #32C88C;font-size: 1rem;font-family: Helvetica, Arial, sans-serif;text-align: center;outline: 0;line-height: 1;cursor: pointer;-webkit-transition: background 0.3s, color 0.3s, border 0.3s;transition: background 0.3s, color 0.3s, border 0.3s; box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.6);">Click here to subscribe</button>
I only put <script src="//static.leadpages.net/leadboxes/current/embed.js" async defer></script> in the page JS. and then I added this custom attribute: Screen Shot 2020-04-12 at 8.35.53 PM

This is for the download button at https://www.austinstoneworship.com/music/somethinggreater/ I currently have the JS in the global JS area as well…as that was the only way for me to get it to work.

Hello Philip,

Please be advised that you are not suppose to insert <script> in the global JS or Cornerstone’s custom JS area. It will create issues and the script will not work. We would highly recommend that you install Insert Headers and Footers plugin. Once installed, please go to Settings > Insert Headers and Footers > Footer and then insert your custom JS code.

Hope this helps.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.