Iframe issues in Firefox and Internet Explorer

4

I have a problem with Firefox and Internet Explorer when I use a iframe to load files on the same page.

In Chrome it works perfectly, but in Firefox and Internet Explorer, when I click on link iframe opens on another page.

Does anyone have a solution or an alternative?

The sample code below can be seen in JSFiddle or in this experiment page .

<li><a href="pagina-1.htm" target="plantas" class="">pagina 1</a></li>
<li><a href="pagina-2.htm" target="plantas" class="">pagina 2</a></li>
<li><a href="pagina-3.htm" target="plantas" class="">pagina 3</a></li>  
<li><a href="pagina-4.htm" target="plantas" class="">pagina 4</a></li>
<li><a href="pagina-5.htm" target="plantas" class="">pagina 5</a></li>
<li><a href="pagina-6.htm" target="plantas" class="">pagina 6</a></li>

<iframe id="plantas" height="500"  width="887" src="pagina-1.htm"
 frameborder="0"  scrolling="no"></iframe>
    
asked by anonymous 28.02.2014 / 21:56

1 answer

4

In your iFrame it is the name that should be used, not the id

Try this way, using name="plantas" :

<iframe id="plantas" name="plantas" height="500"  width="887" src="pagina-1.htm" frameborder="0"  scrolling="no"></iframe>

Example

According to MDN documentation :

  

name
  A name for the embedded browsing context (or frame). This can be used as the value of the target attribute of an <a> or <form> element, or the formtarget attribute of an <input> or <button> element.

In Portuguese:

  

name
  The name for the frame context. This can be used as the target attribute value of a <a> or <form> element, or the formtarget attribute of a <input> or <button> element.

    
28.02.2014 / 22:00