0

I have been trying to follow the instructions in this question, but have been having an issue. Namely: it doesn't work. I have been trying to do the method described in the second answer (the one that uses the object tag). This is the code that I am putting in my body tag:

<!--[if IE]>
<object classid="clsid:25336920-03F9-11CF-8FD0-00AA00686F13" data="http://www.google.be">
<p>backup content</p>
</object>
<![endif]-->

<!--[if !IE]> <-->
<object type="text/html" data="http://www.flickr.com" style="width:100%; height:100%">
<p>backup content</p>
</object>
<!--> <![endif]-->

This above code does not work. Flickr is not loaded and nothing appears on the page other than a poll by some other site that is totally unaffiliated with me. I don't know why that is loaded. It is definitely from this code and it happens whether or not that first section is there. I think that it may be because of "< p >backup content< /p >" (the spaces are so that it is not reformatted as HTML).

I have also tried giving the object a set height (2500px) but that does nothing.

Does anybody know why this is not working?

Any advice/help is greatly appreciated!

3
  • <object> for loading HTML documents is essentially an <iframe> with some features missing and with worse documentation. Use an iframe.
    – Quentin
    Aug 1, 2015 at 8:38
  • @Quentin - will an iframe load flickr.com (for example) in effect scaled to the iframe's proportions? Will it be interactive (I can click buttons in the iframe etc.)
    – Daniel
    Aug 1, 2015 at 8:40
  • It won't scale the content of it, the content will be interactive, just like an <object> if you got that working.
    – Quentin
    Aug 1, 2015 at 8:41

1 Answer 1

0

From my JavaScript console when I try to run that code in Firefox:

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

Flickr doesn't allow you to put its homepage in a frame (and a frame created by an object element is still a frame).

4
  • Would jQuery get around this?
    – Daniel
    Aug 1, 2015 at 8:46
  • No. You can't override security settings from third party sites with client side code.
    – Quentin
    Aug 1, 2015 at 8:47
  • ok. good to know. Is there a way to check if a website does not allow itself to be put in an iframe?
    – Daniel
    Aug 1, 2015 at 8:48
  • Look at the HTTP headers it sends in its responses or look for that error message in your console when you try.
    – Quentin
    Aug 1, 2015 at 8:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.