Jump to content

Code Blocks and Javascript on site in development

Recommended Posts

Hi

I'm a Squarespace noob.
1. The objective: to populate a Squarespace page with data/html from a backend system, using Ajax.
2. Testing javascript: I've created a Code Block on a page, and added some simple, vanilla javascript:
<div id="displayDiv"></div>
<script type="javascript">
document.getElementById("displayDiv").innerHTML ="<h2>Omkara's lab block</h2>";
</script>
3. As expected I get a "Embedded scripts" for the block and are asked to "view in safe mode"
4. Once I enter safe preview mode I am (as expected) told to log out and view the page

However, once logged out I can not view the page as the site is in development and hence not published!
What am I missing here?

Also, if anyone knows of other waya to include data from another system without using Ajax (which may cause issues), it would be cool to know about them

Yours

Omkara

Link to comment
  • Replies 1
  • Views 499
  • Created
  • Last Reply

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.