Cant add script tag in text element

Hi

While adding a script element in topbar works beautifully, when I want to add it to a text element it does not work and keeps returning an empty state.

What could be missed?

Hi there,

Would you mind providing us with JS code that you are trying to add and the URL of the site in question?

Is possible that the code is causing a conflict issue with you try adding it to the content area.

For the meantime, please check this link on how to diagnose Javascript errors:

https://codex.wordpress.org/Using_Your_Browser_to_Diagnose_JavaScript_Errors

Hope this helps.

Thanks,

Here is the script. It works fin in the topbar, but when trying to add it in another section nothing happens

Hi There @quinex

I have tested your sample JavaScript code on my test site, using Raw element and I see that’s it is functioning properly.

You need to troubleshoot your issue by following the guidelines below.

  1. Make sure that you’re using the latest version of X/Pro/Cornerstone by following our version information here (https://theme.co/apex/forum/t/troubleshooting-version-compatibility/195) and update if required (https://theme.co/apex/forum/t/setup-updating-your-themes-and-plugins/62).
  2. If you’re using a child theme, switch to your parent theme and see if your child theme customizations are conflicting with this issue.
  3. Disable all of your 3rd party plugins except your Cornerstone plugin and test for a plugin conflict. If the issue is resolved, then you can activate your plugins one by one to see which plugin causing this issue.
  4. If you have added any custom JavaScript into you site, remove them temporarily and test your issue further.

Hope that helps.

Thanks… in case of a conflict should that not need to have affect on the same script being used in the topbar then?

Hi @quinex,

The fact that the script works on our end both on RAW Content element and Topbar means the script has no conflict with the Theme, except Cornerstone wont generate a preview intentionally to avoid JS conflict on the page builder/editor.

If your script does not work on the front-end It could be something on the content of the page that is causing the issue, it could be a broken HTML markup or an invalid shortcode, or another script that is on your page.

It can also be a caching related, please clear all your caching features (plugin, server-side, CDN, and browser’s cache).

Let us know how it goes,
Cheers!

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