• Resolved markemark

    (@markemark)


    Help – just updated plugins – and now no images are showing on home page,

    just have one error in the console

    Uncaught SyntaxError: unterminated regular expression literal

    Which seems to be caused by the strange <p> </p> tags appearing in the <script> shown below?

    Any ideas how to fix this?
    I checked, using wordfence, all the plugin files had not been altered.

    FY – this is a site I have inherited, so am unfamiliar with TranslatePress

    Thanks

    ——————————-

    <div class="trp-ls-shortcode-language">
                    <a href="javascript:void(0)" class="trp-ls-shortcode-disabled-language trp-ls-disabled-language"  title="English"><br />
    			<img loading="lazy" class="trp-flag-image" src="https://janiquesvedberg.com/wp-content/plugins/translatepress-multilingual/assets/images/flags/en_US.png" width="18" height="12" alt="en_US" title="English"> English		</a><br />
                        <a href="https://janiquesvedberg.com/" title="Svenska"><br />
                <img loading="lazy" class="trp-flag-image" src="https://janiquesvedberg.com/wp-content/plugins/translatepress-multilingual/assets/images/flags/sv_SE.png" width="18" height="12" alt="sv_SE" title="Svenska"> Svenska        </a></p></div>
    <p>    <script type="application/javascript">
            // need to have the same with set from JS on both divs. Otherwise it can push stuff around in HTML
            var trp_ls_shortcodes = document.querySelectorAll('.trp-language-switcher');
            if ( trp_ls_shortcodes.length > 0) {
                // get the last language switcher added
                var trp_el = trp_ls_shortcodes[trp_ls_shortcodes.length - 1];
                var trp_shortcode_language_item = trp_el.querySelector('.trp-ls-shortcode-language')</p>
    <p>            // set width
                var trp_ls_shortcode_width = trp_shortcode_language_item.offsetWidth + 5;
                trp_shortcode_language_item.style.width = trp_ls_shortcode_width + 'px';
                trp_el.querySelector('.trp-ls-shortcode-current-language').style.width = trp_ls_shortcode_width + 'px';</p>
    <p>            // We're putting this on display: none after we have its width.
                trp_shortcode_language_item.style.display = 'none';
            }
        </script>
    </div>
    • This topic was modified 4 years, 2 months ago by markemark.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Thread Starter markemark

    (@markemark)

    checked through the site and found the [language-switcher] shortcode being using in a TEXT widget in the footer – switched this for a HTML widget and hey – no error.

Viewing 1 replies (of 1 total)
  • The topic ‘[RESOLVED] Uncaught SyntaxError: unterminated regular expression literal’ is closed to new replies.