Anderson Green
Anderson Green

Reputation: 31810

Clicking a link in an iframe has no effect at all

In Google Chrome, I've noticed that clicking some links seems to have no effect at all:

<a href="http://google.com">clicking this link does nothing at all.</a>

Here is a JSBin and a JSFiddle.

Is this normal, or does it indicate that there is some kind of bug with the latest version of Google Chrome? I've never had this issue before, and links like these used to work just fine for me.

Upvotes: 3

Views: 1034

Answers (2)

KennyV
KennyV

Reputation: 832

This is because of the fact that you can't display external pages in iframes. This is a browser limitation mostly for security reasons

Upvotes: -3

Lee Taylor
Lee Taylor

Reputation: 7994

If you look at your developer console, you'll see the following:

Refused to display 'https://www.google.com/' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.

See https://developer.mozilla.org/en-US/docs/HTTP/X-Frame-Options

Upvotes: 7

Related Questions