Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript How To Change An Iframes Src On Click Reply To: How To Change An Iframes Src On Click

#169609
dyr
Participant

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

Read more at MDN about Iframe Same-Origin policies. This is a server configuration.

Notice in my example the URLs I’ve linked in the <select> are CodePEN URLs which of course have no problem being shown in an Iframe on CodePEN. Could you try something like what I showed but on your site? As long as the page the Iframe is on and the URL you load into it are on the same domain you won’t have that problem.