Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1322105
    Andreas Bjerve
    Participant

    Hi,

    I was told there is a java-script error on my site, but I don´t have the brains to see it or correct it myself. I was told “there are multiple punctuation errors and the closing script tag is followed by more javascript code which is incorrect”. Could you guys have a look and perhaps provide me with the correct code?

    <script id=”cornerstone-custom-page-js”><div;id=”fb-root”></div>;<script>(function(d, s, id) {; var js, fjs = d.getElementsByTagName(s)[0];; if (d.getElementById(id)) return;; js = d.createElement(s); js.id = id;; js.src = “//connect.facebook.net/nb_NO/sdk.js#xfbml=1&version=v2.8″;; fjs.parentNode.insertBefore(js, fjs);;}(document, ‘script’, ‘facebook-jssdk’));</script>;;(function($){;; $(‘a.manual-optin-trigger’).attr(‘data-optin-slug’,’byyrzaftyzdz4ctu’);; ;})(jQuery);”

    #1322106
    Andreas Bjerve
    Participant
    This reply has been marked as private.
    #1322152
    Thai
    Moderator

    Hi There,

    You should put that script under functions.php file locates in your child theme:

    add_action( 'wp_head', 'add_custom_script' );
    function add_custom_script(){
    	?>
    		<div id="fb-root"></div>;<script>(function(d, s, id) {; var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/nb_NO/sdk.js#xfbml=1&version=v2.8"; fjs.parentNode.insertBefore(js, fjs);}(document, 'script', 'facebook-jssdk'));</script>;
    	<?php
    }

    Regards!

    #1322207
    Andreas Bjerve
    Participant

    Right, thanks! Then I´m gonna go right ahead and ask another stupid question; where do I locate and edit the functions.php file?

    Also, should I remove this following Javascript from my home-page then?

    <div id=”fb-root”></div>
    <script>(function(d, s, id) {
    var js, fjs = d.getElementsByTagName(s)[0];
    if (d.getElementById(id)) return;
    js = d.createElement(s); js.id = id;
    js.src = “//connect.facebook.net/nb_NO/sdk.js#xfbml=1&version=v2.8”;
    fjs.parentNode.insertBefore(js, fjs);
    }(document, ‘script’, ‘facebook-jssdk’));</script>
    (function($){

    $(‘a.manual-optin-trigger’).attr(‘data-optin-slug’,’byyrzaftyzdz4ctu’);
    }

    Thanks 😀

    #1322218
    Christopher
    Moderator

    Hi there,

    Please connect to FTP and find functions.phph file under wp-content/themes/x-child .
    Yes, please remove the code from home page.

    Hope it helps.

  • <script> jQuery(function($){ $("#no-reply-1322105 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>