Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1197821
    breatheprana108
    Participant

    Hi,

    I’m trying to embed a bit of javascript in my site, but I am not sure how to add it to the Glogal Javascript, then have it appear in a widget area. Can you help?

    Website:

    Sunset Moon Wellness Center Home

    It’s a square up appointments widget:

    <!– Start Square Appointments Embed Code –><script src=’https://squareup.com/appointments/buyer/widget/d2f9c7e6-b202-48d2-94f0-6b1d7647566a/05FYBR52ZDJ10.js’></script>&lt;!– End Square Appointments EmbedCode –>

    I also need to put more than one.

    #1197822
    breatheprana108
    Participant
    This reply has been marked as private.
    #1198039
    Jade
    Moderator

    Hi there,

    Please add the code in side a Raw Content element to the page that you want to add it on.

    Hope this helps.

    #1199630
    breatheprana108
    Participant

    Hi I did that in cornerstone and it would not allow me to do it. It’s throwing a notification to add to global JS area.

    #1199929
    Lely
    Moderator

    Hi There,

    I tried to login and check but then the credentials is not working. It is throwing this error:
    ERROR: The username or password you entered is incorrect.

    On my test site I got this:http://screencast-o-matic.com/watch/cD6eVLjtBt
    But then it stop Cornertone because of the following error:

    The Content Security Policy 'default-src 'self' appointments-production-f.squarecdn.com; img-src 'self' data: api.mapbox.com square-go-production.s3.amazonaws.com/ www.google-analytics.com/collect appointments-production.s3.amazonaws.com/ appointments-production-f.squarecdn.com api.squareup.com/; script-src 'self' 'unsafe-inline' appointments-production-f.squarecdn.com js-agent.newrelic.com/ bam.nr-data.net/; style-src 'self' 'unsafe-inline' appointments-production-f.squarecdn.com' was delivered in report-only mode, but does not specify a 'report-uri'; the policy will have no effect. Please either add a 'report-uri' directive, or deliver the policy via the 'Content-Security-Policy' header.
    builder.min.js?ver=1.3.0:1 Uncaught SecurityError: Blocked a frame with origin "http://virtualhost.dev" from accessing a frame with origin "https://squareup.com".  The frame requesting access has a protocol of "http", the frame being accessed has a protocol of "https". Protocols must match.
    #1200531
    breatheprana108
    Participant

    What should I do to remove this error? Do I need sorest up an API?

    #1200840
    Nabeel A
    Moderator

    Hi again,

    Instead of adding the above code in Raw Content, add it in your Child Theme’s functions.php:

    add_action('wp_head','embed_code');
    function embed_code() { 
    ?>
    <script src="https://squareup.com/appointments/buyer/widget/d2f9c7e6-b202-48d2-94f0-6b1d7647566a/05FYBR52ZDJ10.js"></script>
    <?php 
    }

    Let us know how this goes!

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