Avatar of ES-Components
ES-Components
Flag for United States of America asked on

How To Create an iFrame in SquareSpace Using A Code Block?

SquareSpace allows me to use a HTML Code Block to insert HTML code for an iFrame. Below is the basic
HTML Code I am using
<iframe src="https://www.escomp.com/IndexSearch1.php" style="border:2px solid red;" title="Iframe Example"></iframe>
Our current website is secure. https://www.escomponents.com

When I enter the html code I get www.escomp.com refuses to connect I verified that this address is secure, it has an SSL certificate. If I use any browser and type in https://wwwescomp.com/IndexSearch1.php
I can view the page.

What is preventing the iFrame to work?????? Is there some other security issue that needs to be resolved?

Any help would be greatly appreciated!!

Thanks...
Rick

  
HTML* iframeSquarespace

Avatar of undefined
Last Comment
Scott Fell

8/22/2022 - Mon
Scott Fell

It is because that site does not allow frames. The x-frame-options is set to SAMEORIGIN

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options


ES-Components

ASKER
Hi Scott!
I think I understand, but here is my question. The site I want in the iframe
(https://www.escomp.com/IndexSearch1.php) is hosted by Network Solutions for us. Is Network Solutions
the one to be able to fix the x-frame option???

Thanks...
Rick
Scott Fell

Yes. They can either do for you or perhaps point you in the right direction on how to do it yourself or they may have a global setting for everybody and there is nothing you can do.

Frankly, you would be better off having a form on Squarespace that submits the search parameters to your other site via an ajax request. Your other site can send json data back that your Squarespace page can digest and output to the screen. It would be a much better experience.

FYI, I saw on your results page, if you do not enter any parameters, it spits out your entire set of results which s what to large.  You should either force adding a parameter or limit the results to 100 rows or some other limit. 



All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
ES-Components

ASKER
Scott,
Thanks for your comments. I did go back to our Hosting site and their answer was no. They have set it globally and there is nothing I can do. We currently have a Red Part Search Button on our website ( https://www.escomponents.com
What we were attempting to do was to get that Search Part Page to appear in an iframe rather than clicking a button first.
I am not a programmer, so what little I have learned, I am not sure if this can be done. We would have to have a form
in Squarespace query a Database that's referenced on that Search Part Page and then display the results. More than likely, I would have to hire a Squarespace programmer to make this connection. AND besides, iframes have become
old school and do pose a security risk if you are accessing a site outside your domain. I will accept your solution!
AND thanks again for the helpful insight.
Rick

ASKER CERTIFIED SOLUTION
Scott Fell

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.