Pierre François
Pierre François

Reputation: 6061

HTML: href attribute doesn't open an URL when passing variables into an iframe as target

I have a webpage for viewing some websites inside of an iframe (having "viewport" as name attribute).

When I click on next button, nothing happens:

<a href="https://www.google.be/search?hl=en&site=imghp&tbm=isch&source=hp&q=site%3Aromanliturgy.org" target="viewport" ><button type="button">View</button></a>

But when I paste the URL "https://www.google.be/search?hl=en&site=imghp&tbm=isch&source=hp&q=site%3Aromanliturgy.org" manually into a new tab of the browser, it works.

This issue doesn't occur with a simple URL as "http://themusicpoint.tumblr.com/archive"

I have no idea about what is wrong. Any help would be appreciated. Thanks in advance.

Upvotes: 0

Views: 38

Answers (1)

jSource
jSource

Reputation: 524

The site www.google.be does not allow that page to be displayed in an iframe on a different site. (The HTTP header X-Frame-Options is set to SAMEORIGIN)

The error message in the Firefox console is the following:

Load denied by X-Frame-Options: https://www.google.be/search?hl=en&site=imghp&tbm=isch&source=hp&q=site%3Aromanliturgy.org does not permit cross-origin framing.

Upvotes: 1

Related Questions