1

I want to open my website in another website. But when i try to open only white screen shows. I don't know the reason. If you have an idea, please share with me.

I tried this:

<iframe src="demo_iframe.htm" name="iframe_a"></iframe>
<p><a href="http://www.example.com" target="iframe_a">Try this</a></p>

or http://www.dizimagyeni.com/dizi-izle.php?dizi=Test&url=http://www.example.com

it worked correct.

But if I try another website(belongs to me) only white screen shows. What can cause this?

Farukest
  • 1,498
  • 21
  • 39
  • 4
    many sites have code to stop you framing them. –  Jul 28 '14 at 20:44
  • Try [fancybox](http://fancybox.net/home) – SpencerX Jul 28 '14 at 20:45
  • this is probably a "cross-domain policy" restriction. see: http://stackoverflow.com/questions/4174317/#answer-4174355 – Radley Sustaire Jul 28 '14 at 20:46
  • @dragon I know but it is my website, i want to allow. Is this related with nginx configuration ? – Farukest Jul 28 '14 at 20:47
  • Do you control "another website"? If you don't, then you are at the mercy of whether they want to allow it or not. They can choose not to allow you to create an iframe on their site, as Dagon suggests. – entropic Jul 28 '14 at 20:53
  • 2
    What is the website that is not allowed? If we can see an example of it not working, that would help enormously (and if we can't see that, we can only guess). Or you could check your browser consoles when it is loading, to see if there are any errors. – halfer Jul 28 '14 at 20:54
  • @entropic "another website" belongs to me. I can change configuration but i dont have any idea how do i allow iframe. – Farukest Jul 28 '14 at 20:59
  • 1
    @halfer i tried, i couldn't see any error but i saw on the browser i have a configuration about the frame, but i'm not sure. Do you know the `X-Frame-Options:SAMEORIGIN`, should i remove it in my nginx.conf ? – Farukest Jul 28 '14 at 21:01
  • I've not heard of that, but it sounds promising. I suggest you do a web search for it, and see what it does. In particular, see what browsers support it too. I wasn't aware there's a server option to allow sites to be non-frameable - usually iframing is stopped via JavaScript. – halfer Jul 28 '14 at 21:05
  • Thank you @halfer your answer helped me to see my problem. I solved now, it was about the nginx configuration, i removed this frame blocking option `X-Frame-Options:SAMEORIGIN` in nginx.conf, now it works. – Farukest Jul 28 '14 at 21:08
  • Great! Please make an answer out of that, it may well be helpful for someone else. – halfer Jul 28 '14 at 21:12

1 Answers1

1

I want to share my solution, maybe it helps someone who searching this answer. it was about the nginx configuration Remove the X-Frame-Options:SAMEORIGIN line or comment with # in nginx.conf file and it will work.

Farukest
  • 1,498
  • 21
  • 39