Jump to content

Squarespace editor stopped working after adding script

Recommended Posts

Posted

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

  • Replies 1
  • Views 504
  • Created
  • Last Reply
Posted
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 - PDF Lightbox popup - ...) </>  🗓️ Delivery Date Picker (Date picker form field)
Gallery block 7.1 workaround </> No-code customisations for Squarespace

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.