How to change the "src" of an iframe without changing the user's URL?

3

How do I change the contents of an iframe internally without changing the URL of the site?

Example: The user entered my site: http://example.com and it contains an iframe:

<iframe src="http://teste455.esy.es/v3/wp-content/arcade/?url=RockmanX3(J).smc&amp;system=snes&amp;plataforma=snes" width="640" height="500" scrolling="no"></iframe>

In this iframe you have a link. How do I instead of using multiple iframes on a page, I can change the iframe content, in this case the link, only with a drop down menu that when the iframe content is clicked changes?

It would be just like a playlist and would have a drop-down menu above the iframe and clicking the iframe link would change to another if that is the same as the one above.

I would like to do this in a single HTML page.

    
asked by anonymous 14.10.2015 / 01:51

1 answer

4

As this this great answer , iframe is simply a relative of the old frame , then it's just a

<iframe width="500" height="500" src="about:blank" name="testframe"></iframe>

<a href="http://example.com/pagina-1" target="testframe">Um</a>
<a href="http://example.com/pagina-2" target="testframe">Dois</a>
    
14.10.2015 / 04:47