Log in

View Full Version : iframe problem in HTML5



Burgin
08-02-2011, 12:53 PM
I've been using this code to give me 3 image links that change the pages being displayed in an <iframe name="a-comments"> and they worked fine.
I've tried using them in a HTML5 test and changed it to <iframe id="a-comments"> in order to validate the code and they work great in Chrome but Firefox and IE8 open the links in a new tab. Any ideas whats going on?
The code...

<a href="media/mad-mountainbikes.htm" target="a-comments" title="Photos &amp; Films (Default)"><img src="../img/icon-med.png" width="30" height="30" alt="media"></a>&nbsp;
<a href="../reviews/mad-mountainbikes-reviews.php" target="a-comments" title="Reviews"><img src="../img/icon-rev.png" width="35" height="29" alt="reviews"></a>&nbsp;
<a href="social/mad-mountainbikes.htm" target="a-comments" title="Social Media"><img src="../img/icon-soc.png" width="30" height="30" alt="social"></a>

traq
08-02-2011, 03:19 PM
the name on iframes is still valid in html5 (http://www.w3.org/TR/html5/the-iframe-element.html#the-iframe-element). Always double-check validator errors in html5 mode (it's still experimental).

Burgin
08-02-2011, 03:37 PM
Thanks traq

I also had to remove a few meta tags I liked to use, could they possibly be valid? Whats a good way to double check?

traq
08-02-2011, 07:49 PM
if you can follow it, the w3c spec (which I liked to above) is best.

however, a better approach is to rely on what works as opposed to what is technically valid - many parts of html5 aren't supported - or not widely supported - yet.

could you post the <meta> tags in question?

Burgin
08-03-2011, 06:24 AM
Here they are...

<meta name="distribution" content="global" />
<meta name="copyright" content="Cherrys MOT Centre" />
<meta name="owner" content="Cherrys MOT Centre" />

traq
08-03-2011, 06:52 AM
huh... I didn't realize, but it seems that html5 defines valid meta tag names. You can also propose your own (http://wiki.whatwg.org/wiki/MetaExtensions).

on the other hand, just because these are "invalid" doesn't mean you can't use them. They will simply be ignored - but guess what, current browsers ignore them anyway. I'd say, leave them in if you prefer.

JShor
08-03-2011, 09:00 PM
I didn't know you could do that in HTML5 either. Interesting.