Jump to content

Squarespace editor stopped working after adding script

Recommended Posts

Site URL: https://cello-octahedron-fc3t.squarespace.com

Hi, I have embedded an RSS feed to my squarespace site and after saving the page, that page is no more editable. Clicking on edit(Pencil) icon doesn't work. It ends up only by deleting the page. I'm using following script for that

<script src="https://rss.bloople.net/?url=https%3A%2F%2Fwww.comicsrss.com%2Frss%2Fjumpstart.rss&limit=1&showtitle=false&type=js"></script>

Although it's working fine when actually preview the site but squarespace editor is not working, is there any way that we can stop running the scripts in editor mode or something like that?

Thanks in Advance

Link to comment
  • Replies 1
  • Created
  • Last Reply
On 7/22/2020 at 5:42 PM, Sanjeev1236 said:

Site URL: https://cello-octahedron-fc3t.squarespace.com

Hi, I have embedded an RSS feed to my squarespace site and after saving the page, that page is no more editable. Clicking on edit(Pencil) icon doesn't work. It ends up only by deleting the page. I'm using following script for that

<script src="https://rss.bloople.net/?url=https%3A%2F%2Fwww.comicsrss.com%2Frss%2Fjumpstart.rss&limit=1&showtitle=false&type=js"></script>

Although it's working fine when actually preview the site but squarespace editor is not working, is there any way that we can stop running the scripts in editor mode or something like that?

Thanks in Advance

Hi there,

You can use this script to detect if the page is in editor or not, then append the rss script accordingly

<script>
	document.addEventListener('DOMContentLoaded', function() {
      if ( window.location == window.parent.location ) {
          var script = document.createElement('script');
          script.type = 'text/javascript';
          script.src = 'https://rss.bloople.net/?url=https%3A%2F%2Fwww.comicsrss.com%2Frss%2Fjumpstart.rss&limit=1&showtitle=false&type=js';    

          document.getElementsByTagName('head')[0].appendChild(script);
      } else {
          console.log('iframe');
      }
  });
</script>

 

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date format)
💫 Animated Buttons (Referral URL)
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.