Jump to content

Can't seem to solve for "Scripts Disabled" when attempting to embed a widget via a Code Block on a page.

Recommended Posts

Hello --

Hoping someone may be able to help me with getting a web widget to appear. Code provided below. 

Each time I save the page with the code block, I'm getting the "Scripts Disabled" error. I've done everything I've read to do, and still can't get the web widget to populate (it's just showing as blank). 

Steps to try and resolve the issue:

  • added the code to the "header section" of the code injection page 
  • Made sure code was tied to proper libraries 
  • Open an private browsing tab to view the webpage 

Here is the code for the widget I am working with. Any help getting this to work is greatly appreciated.

<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="https://unpkg.com/@openai/chat-widget@latest/dist/chat-widget.js"></script>

<div id="chat-widget-container"></div>

<script>
  var chatWidget = new ChatWidget({
    apiKey: 'YOUR_API_KEY', // Replace with your own API key
    targetElement: '#chat-widget-container',
    prompt: 'Welcome to the resume formatting tool! Please input a sentence from your resume, and I will suggest ways to improve its formatting.',
    inputPlaceholder: 'Enter a sentence from your resume...',
  });

</script>
 
 
 

Screen Shot 2022-12-13 at 8.02.06 AM.png

Screen Shot 2022-12-13 at 8.02.28 AM.png

Link to comment
  • Replies 4
  • Views 550
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

18 minutes ago, natemonseu said:

Each time I save the page with the code block, I'm getting the "Scripts Disabled" error.

I'm assuming that you added a genuine API KEY after taking the screenshots? If yes, please include a working link to the page so we can see the code in action. If you're unsure how to do this, please see How to Post a Forum Question.

Did this help? Please give feedback by clicking an icon below  ⬇️

Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥.
Work: Founder of SF.DIGITAL. We provide high quality original extensions to supercharge your Squarespace website. 
Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links.
Forum advice is completely free. You can thank me by selecting a feedback emoji. Buying a coffee is generous but optional.

Link to comment

The source URL in the following code appears not to exist.

<script src="https://unpkg.com/@openai/chat-widget@latest/dist/chat-widget.js"></script>

1226728196_ScreenShot2022-12-14at11_31_21AM.png.4bd104e87c17fde0306f57a967cce14c.png

I'm thinking you might be following some old install instructions.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.