XHTML Strict

33 views
Skip to first unread message

Rob Loach

unread,
Aug 9, 2007, 5:20:35 PM8/9/07
to reCAPTCHA
Hello,

When run through Markup Validation from W3C, you get a number of
validation errors when it comes to the reCAPTCHA form. Are there any
plans to fix this?

http://validator.w3.org

Thanks a lot!

Rob Loach
http://www.robloach.net

reCAPTCHA Support

unread,
Aug 9, 2007, 7:08:23 PM8/9/07
to reca...@googlegroups.com
Hello Rob,

It actually turns out the problems are deeper than this. We use document.write, which is not valid with XHTML. Very few AJAX apis (Google Maps, Adsense, many counters, etc) are actually XHTML compliant, even though the markup may appear to be valid XML.
--
reCAPTCHA: stop spam, read books
http://recaptcha.net

eddy

unread,
Aug 17, 2007, 6:12:51 AM8/17/07
to reCAPTCHA
Hi,

I too am having issues with XHTML validation, but I don't believe it
is just down to the document.write calls. The errors I'm getting are
due to unclosed tags:

...h="500" frameborder="0"></iframe><br> (this should be <br /> for
XHTML)
...onse_field" value="manual_challenge"> (Input tag should end /> for
XHTML)

Please can these be fixed?

Edward


On Aug 10, 12:08 am, "reCAPTCHA Support" <supp...@recaptcha.net>
wrote:


> Hello Rob,
>
> It actually turns out the problems are deeper than this. We use
> document.write, which is not valid with XHTML. Very few AJAX apis (Google
> Maps, Adsense, many counters, etc) are actually XHTML compliant, even though
> the markup may appear to be valid XML.
>

> On 8/9/07, Rob Loach <roblo...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Hello,
>
> > When run through Markup Validation from W3C, you get a number of
> > validation errors when it comes to the reCAPTCHA form. Are there any
> > plans to fix this?
>
> >http://validator.w3.org
>
> > Thanks a lot!
>
> > Rob Loach
> >http://www.robloach.net
>
> --

> reCAPTCHA: stop spam, read bookshttp://recaptcha.net- Hide quoted text -
>
> - Show quoted text -

reCAPTCHA Support

unread,
Aug 18, 2007, 4:35:53 PM8/18/07
to reca...@googlegroups.com
The issue is that even if we fix these issues, document.write will still make it invalid HTML (even if the w3c thing can't detect this). Also, it's impossible to make a non-javascript version of the challenge that is XHTML Strict.

Very few websites are actually valid XHTML, even if the w3c validator lets them pass (due to uses of document.write, for example).

Joe Audette

unread,
Aug 18, 2007, 4:42:35 PM8/18/07
to reca...@googlegroups.com
<br> is not even valid for xhtml transitional
Why not just change it to <br /> ?
Its a simple solution. Why not just do the right thing and fix it?

Joe


--
Joe Audette
Software Solutions Architect
Source Tree Solutions, LLC
joe.a...@gmail.com
http://www.sourcetreesolutions.com
http://www.mojoportal.com

reCAPTCHA Support

unread,
Aug 18, 2007, 4:49:42 PM8/18/07
to reca...@googlegroups.com
We can go ahead and make that change. However, this does nothing to make the document actually valid XHTML transitional. Even if we do make the markup valid, the Javascript will still cause invalid XHTML (as do many, many other Javascript APIs). For example, you'd be unable to serve a page with reCAPTCHA using the xml mime type (just as you couldn't serve a page with AdSense using this mime type).

http://www.hixie.ch/advocacy/xhtml

is a point of view worth reading on this matter.

-Ben

Joe Audette

unread,
Aug 18, 2007, 4:58:27 PM8/18/07
to reca...@googlegroups.com
Interesting read
I'm just shooting for valid xhtml transitional and I'm using
application/xhtml+xml
I think we should try and make things as valid as possible even if we
can't get all the way there all the time. So I'm glad you will make
the change from <br> to <br />

Thanks,

reCAPTCHA Support

unread,
Aug 18, 2007, 5:04:55 PM8/18/07
to reca...@googlegroups.com
Joe,

reCAPTCHA will not work with application/xhtml+xml. The issue is that this MIME type prohibits document.write. So, it breaks quite a few javascript APIs (Google Maps, AdSense, etc). While there are some ways that this can be worked around, it's very hard to support this, as it requires more testing.

Joe Audette

unread,
Aug 18, 2007, 5:07:55 PM8/18/07
to reca...@googlegroups.com
It works for me as does AdSense so I don't what you mean by "breaks"

Marcus Andersson

unread,
Sep 5, 2007, 10:59:34 AM9/5/07
to reCAPTCHA
Hi,

I also depend on proper XHTML validation. The JavaScript imported
does break validation to a certain extent.

No matter what our opinions on XHTML are, a lot of websites depend on
it due to large scale web-, templating- and component-frameworks
automatically generating xhtml.

Your comments below that you require document.write to support the API
can be circumvented. I believe that you should also support an XHTML-
compliant version along with the perhaps easier to use current
solution. An XHTML version could simply fill in an xhtml structure
that is also provided. Most web-systems have the capability to import
pages into another. The following pseudo-code illustrates this
example:
...
<head>
<script language="JavaScript" src="http://recaptcha.net/
functions.js" type="text/javascript"></script>
</head>
...
<form>
<myTag:import src="http://recaptcha.net/skeleton.xhtml" />
</form>
...

To clarify, the skeleton.xhtml would contain the parts that the
current JavaScript-implementation is generating dynamically through
document.write(). The XHTML-compliant JS included in the header would
simply traverse the DOM and fill in any required fields such as the
img src.

This way validation would work for sites that require it.

Best wishes,
Marcus

Reply all
Reply to author
Forward
0 new messages