Forum Moderators: open
my website is using XHTML 1.0 Strict, the only way i've found to embeed Google Maps, and having the code validated, is using 'object' instead of 'Iframe', which it works in FF only and not in IE 6&7.
Here's the code i'm using, please any idea how to maintain the code validated and working in IE as well?
Thanks!
tito
<object style="width:300px;height:300px" data="http://maps.google.com/?q=address-etc---" type="text/html"></object>
<body id="contacts">
The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).
One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error).
We'll, this seems to be a lot more frustrating than it should be, doesn't it. I'll do some research on this - sorry not to have a solution right now. Maybe someone else has one?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> Don't ever reduce core functionality simply to satisfy a validator - it makes absolutely no difference to the browser which XHTML version you choose. In this case, you need an
iframe, so you need a transitional DTD if you want it to validate.
object element was supposed to have replaced iframe, but the problems with object in IE6 meant that iframe is here to stay. I wouldn't say that the exclusion of
iframe from the Strict versions of (X)HTML was completely misguided, but it simply doesn't fit with the reality of current browsers. So you can use a transitional doctype, or use a strict one if you don't mind the inconsequential validation error for the one element.
sincerly, i've spent two months in developing a fully 'triple A' validated website, as per W3C rec.
so what's the use?
i don't understand why google has still to provide an Iframe solution, i can understand that back in the '90s but aren't we going to the web2.0 nowadays?
encyclo:
object was the only workaround i've found, but it doesn't work in IE6 and IE7.
at this point i have two solutions: trying to find a way, with javascript maybe?, but i don't know how, or forget about google maps into an xhtml strict validated websites.
I wonder what the google maps team have to say abt this matter.
iframe is no more or less accessible than using an object in this instance - and basically all you're doing is code-hacking to please an automated validation tool rather than having any impact on accessibility. Same goes for using Javascript - you would end up writing out the iframe via the script, which would get past validation only because the validator doesn't parse the Javascript code. If you want to improve the accessibility of an
iframe, then you can use the same alternative content method that it shares with the object element: <iframe src="" width="" height="">[b]Alternative link to the Google Map here.[/b]</iframe> i don't understand why google has still to provide an Iframe solution
Because - unfortunately - it's the only solution that works.