Jump to content

Injecting a site into another site - Help with iframe code

Recommended Posts

Thanks in advance, I am trying to make a site for a small local franchise, where the giant corporate website allows a free ship to store option... I would really like to "inject" this site into theirs, essentially keeping their header and logo on the page while shopping and ordering through the big corporate website.  Is this possible?  Thank you

Link to comment
  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

I'm seeing the following error.

Refused to display 'https://www.doitbest.com/' in a frame because it set 'X-Frame-Options' to 'sameorigin'.

The means that doitbest have prevented the use of their site in an iframe unless the site making the request is in the same domain as theirs.

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
  • Susana_SQSP changed the title to Injecting a site into another site - Help with iframe code
  • 6 months later...
On 2/20/2022 at 1:13 AM, creedon said:
 in a frame because it set 'X-Frame-Options' to 'sameorigin'.

X-Frame-Options is a header included in the response to the request to state if the domain requested will allow itself to be displayed within a frame. It has nothing to do with javascript or HTML, and cannot be changed by the originator of the request. You can't set X-Frame-Options on the iframe. That is a response header set by the domain from which you are requesting the resource . They have set the header to SAMEORIGIN in this case, which means that they have disallowed loading of the resource in an iframe outside of their domain. So you cannot embed their website into yours. Browsers when see that the response header contains X-Frame-Options: SAMEORIGIN, they check your domain and block the rendering of the <iframe>. It is a security measure to avoid clickjacking.

 

Link to comment

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.