Home>Support>Javascript not working reliably in PageBuilder

Javascript not working reliably in PageBuilder

Notice: This thread is over two years old; the information may be outdated. Please consider creating a new thread if you require free support. If you have an active SiteOrigin Premium license, you can email our premium support desk at [email protected].

I have a piece of Javascript to show reviews in my PageBuilder. The code is:
<script type=”text/javascript” src=”//sites.yext.com/214792-reviews.js”></script>

I created a row, and within that row I’ve tried 3 different widgets: SiteOrigin Editor, Text, and Custom HTML. The reviews shows up in Chrome, but not on Firefox or on Mobile. I’ve also got this code in a widget sidebar of the site that appears on the blog, using a Text widget, and it shows up on all browsers. View the website

Is there an issue with Page Builder and Javascript? Is there any way to fix this?

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 6 years, 5 months ago Alex S
    Hi, I Work Here

    Hi Echo,

    The provided snippet is using proper quotation marks. You should use straight/dumb quotes as proper quotation marks can cause issues in certain browsers so they should ideally be avoided. Please try the following JavaScript:

    <script type="text/javascript" src="//sites.yext.com/214792-reviews.js"></script>

    Please note that I recommend adding the above HTML to the Custom HTML widget.

  2. 6 years, 5 months ago Echo Martin

    Thanks for the fast reply! I’m not sure how the smart quotes ended up in the snippet. They’re dumb quotes on my website. I did, however, replace the Javascript with what you provided just in case in the Custom HTML widget. It’s still not working on Firefox.

    I realize I linked to the homepage and shouldn’t have. The code is used on the Why Us and the Contact page, just before the three column footer with the contact form.

  3. 6 years, 5 months ago Alex S
    Hi, I Work Here

    Hi Echo,

    Thanks. That’s strange, I can’t seem to see this in the markup of either page.

    Would it be possible for you to send me an export of one of those pages? To export a page, please open up the page in the editor and click the Layout button in the Page Builder toolbar. Then click import/export and then click download. Please upload the export to a 3rd party file hosting site such as WeTransfer (no email is required).

  4. 6 years, 5 months ago Echo Martin

    I can definitely do that. Here are the files

  5. 6 years, 5 months ago Alex S
    Hi, I Work Here

    Hi Echo,

    Thanks. The provided layouts work without issue for me regardless of browser. I still can’t seem to see the reviews on your Why Us page as the HTML isn’t present in your markup. Is that page currently working for you in any browser?

    Regardless, are you able to replicate this issue while using FireFox on a different computer?

  6. 6 years, 5 months ago Echo Martin

    Hi Alex,

    I’m using Page Builder in the new WordPress block (Guttenberg?) system. Would that make a difference?

    The page is currently working for me on Google Chrome on my laptop, but not on my phone and not on Firefox. I was first told of the issue by someone else on another computer who couldn’t see it and was expecting it to be there. We both have Macs. I just checked on a Windows 10 computer and it’s not working on their Chrome or Microsoft Edge.

    On all of those, however, the code still works on the Blog page.

    The only one where I’m logged into the site to edit is on Google Chrome on my laptop. Might that be affecting the visibility of the code?

  7. 6 years, 5 months ago Alex S
    Hi, I Work Here

    Hi Echo,

    I just tried the Block Editor (ie. Gutenberg) and it worked without issue for me.
    Does this issue occur when you’re logged in using FireFox?

  8. 6 years, 5 months ago Echo Martin

    I just logged into a computer running Windows 10. It works on Firefox when logged in, but does not appear when using an incognito window. On the same computer, it does not work on Google Chrome when not logged into the site.

  9. 6 years, 5 months ago Alex S
    Hi, I Work Here

    Hi Echo,

    I suspect you may have a caching plugin that is resulting in a difference while being logged in and the logged out version. I would take a look over your plugins for a caching plugin. When you find it, please clear your page cache.

  10. 6 years, 5 months ago Echo Martin

    I found one plugin that was caching (SG Optimizer). I purged the cache and nothing changed. I deactivated the plugin, still no change.

  11. 6 years, 5 months ago Alex S
    Hi, I Work Here

    Hi Echo,

    I would try running a plugin conflict test to try and identify which plugin is doing this. This is not to suggest you’re experiencing a plugin conflict, only that test is a good way to identity what’s doing what. For reference, here’s our typically recomended plugin conflict test:

    This sounds like it could be a plugin conflict issue. Can you try disabling all non-SiteOrigin plugins and see if this fixes the issue? You’ll need to clear all your caches after disabling your plugins.

    If it does fix the issue, then try re-enabling your plugins one by one until the issue comes back. This procedure will help diagnose which plugin is causing the issue.

    Once we know that, we’ll be able to look at what might be causing the conflict and either solve the problem or help you find an alternative plugin.

    If you aren’t using a SiteOrigin theme, then you can also try temporarily switching to one of the default WordPress themes to see if the issue is theme related.

  12. 6 years, 5 months ago Echo Martin

    First, I just want to say that I really appreciate how helpful you’ve been in troubleshooting this.

    Unfortunately, disabling all my plugins except SiteOrigin didn’t work, and switching to a default theme didn’t work.

  13. 6 years, 5 months ago Alex S
    Hi, I Work Here

    Hi Echo,

    Please reach out to your hosting provider and ask if you have any server side caching present.

  14. 6 years, 5 months ago Echo Martin

    Hi Alex,

    Thanks again for all your help. We decided to go with a plugin to do reviews on the site instead of inserting code. That seems to be functioning.

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More