Link to home
Start Free TrialLog in
Avatar of ES-Components
ES-ComponentsFlag for United States of America

asked on

Why doesn't web page open in an iframe?

I am using the following html code for an iframe that I inserted into a code block in Squarespace.
(Squarespace is what I am using for my webpages)

For some reason  when I click on the hyperlink it DOES NOT open in the iframe, but instead opens another page in the browser to display.
See html code below.
Any reason why this would not work in Squarespace??

Thank you...
Rick

CODE FOR IFRAME

<!DOCTYPE html>
<html>
<body>

<h2>Iframe - Target for a Link</h2>

<iframe height="300px" width="350px" src="https://www.escomponents.com" name="iframe_a"></iframe>

<p><a href="https://www.w3schools.com" target="iframe_a">W3Schools</a></p>



</body>
</html>
ASKER CERTIFIED SOLUTION
Avatar of Sam Jacobs
Sam Jacobs
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Squarespace should be irrelevant in this context.

That code is browser code - it is up to the browser to decide what to do with it.

The code works for me - what browser are you testing this in?
Avatar of ES-Components

ASKER

Yes, I know it should work, but for some stupid reason it will not work in Squarespace. The little research I did so far has indicated others have the same problem.

I tested with Chrome, safrari, firefox, etc. It does work.

I guess I will just not be able to do what I had intended to do.

Thanks for your input.
Rick
I don't understand the SquareSpace reference though.

If that is the HTML that ends up in your Browser - where it comes from is no longer relevant?

Is the HTML you have posted exactly what is in the Browser - from a View Source?