Jump to content

Use Java to Load HTML File in Code Block

Recommended Posts

Is there a way to use Java to tell a code block to load the contents of an HTML file already uploaded to squarespace? This solution is needed to be able to make a change to one file that could apply across hundreds of blog posts at the same time.

When I used an iframe and put the source url in the code block to the file, squarespace simply downloads the file every time the page is loaded instead of displaying the content in the file, which is why I thought Java was the solution.

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

Top Posters In This Topic

Top Posters In This Topic

6 minutes ago, noahawaii said:

Is there a way to use Java to tell a code block to load the contents of an HTML file already uploaded to squarespace?

Can you tell us the problem you are trying to solve? Why do you need to load something? What is it for?

A link to the page on the site will also help the community to provide an answer.

By the way, I think you're referring to JavaScript. Java is an entirely different programming language.

About me: I've been a SQSP User for 18 yrs. I was invited to join the Circle when it launched in 2016. I have been a Circle Leader since 2017. I don't work for Squarespace. I value honesty, transparency, diversity and good design ♥.
Work: I founded and run SF.DIGITAL, building Squarespace Extensions to supercharge your commerce website. 
Content: Views and opinions are my own. Links in my posts may refer to SF.DIGITAL products or may be affiliate links.
Forum advice is free. You can thank me by clicking one of the feedback emojis below. Coffee is optional.

Link to comment
12 minutes ago, paul2009 said:

Can you tell us the problem you are trying to solve? Why do you need to load something? What is it for?

A link to the page on the site will also help the community to provide an answer.

By the way, I think you're referring to JavaScript. Java is an entirely different programming language.

Yes I am referring to javascript. My website is in there, but I don't think it's useful for this kind of solution. 

I need to load the html contents of an html file within a code block, and I figured javascript would be the best solution.

Edited by noahawaii
Link to comment

I don't have a specific solution but a comment on a possible direction.

The general pattern some of us have used is to load ones content into a code block in the footer, hide that block, then use JavaScript to move the code into place.

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
  • 1 month later...

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.