function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ManzaManza 

iframe a visualforce page in a website

I am trying to display a visualforce page in a website, however when I do the iframe i get the following error on the website:

Load denied by X-Frame-Options: https://,,,,,, does not permit cross-origin framing.

I am currently using a salesforce app that creates forms, and allows me to embed this forms in external websites the same way, i am trying to embed my VF page, however when I try the forms it works fine.

So I guess it has to be something extra that i need to add in the VF page to allow this?
Best Answer chosen by Manza
logontokartiklogontokartik
can you give more clarification on your requirement. As far as I know you cannot do this as Visualforce pages are on different server vs your app. and in case you are using Force.com sites, there is an option for you to allow Cross Origin.(Clickjack)

Maybe this would help but not definitely sure...

User-added image


All Answers

logontokartiklogontokartik
can you give more clarification on your requirement. As far as I know you cannot do this as Visualforce pages are on different server vs your app. and in case you are using Force.com sites, there is an option for you to allow Cross Origin.(Clickjack)

Maybe this would help but not definitely sure...

User-added image


This was selected as the best answer
ManzaManza
Thank you logontartik for the prompt reply

Yeah, that works, however if you dont mind that I ask, as I am not very familiar with clickjack (other than quick search on google)
is this option really unsafe to use? as you said in my case I have a group of vf page is in a site, the obejective is to gather some data from the website visitors.
My client is a bit particular and want this embededin an iframe. I just want to be more aware of any possible implications