Okay, so I’m trying to iFrame a webpage. I don’t know why, but it won’t stay in my page (it pops out and goes to the main page). The code I’m using is:
<iframe>http://mywebsite.com</iframe>
How do I keep it in my site?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You need to use the
srcproperty.HTML/text content placed inside the tags of an iframe is treated as “fallback” content that only shows up if the browser doesn’t support iframes. See the MDN documentation for full details.
Thus, you were creating an iframe that didn’t point to any page with its
srcproperty (so it remained blank), and had the text “http://mywebsite.com” as fallback text to appear in browsers that don’t support iframes.EDIT:
If you don’t control the site, it’s possible that the framed site has some logic that says something like:
This logic detects if the site is being embedded by someone else (e.g., your own site) and redirects the parent frame. You can confirm whether this is the problem by simply framing IANA’s website,
https://www.iana.org/(or justhttp://www.example.com), which plays nicely when it is framed and doesn’t do parent-frame redirects.