Recent Topics

1 Sep 06, 2006 13:58    

Hi, I have b2evo 1.8.1 running fine with the captcha plugin enabled for comments. It works as intended, and I thank the developers of this plugin. However, in the quest for perfection, I realized the code generated by the plugin dows not validated as XHTML 1.0, as determined by W3C validator.

The error is related to some javascript, and since I'm completely ignorant in Javascript, I wanted to ask here in the forum and hope this is the right subforum.

The validation output from my blog is [url=http://validator.w3.org/check?uri=http%3A%2F%2Fliberal-venezolano.net%2Fblog%2Findex.php%3Fblog%3D5%26p%3D1071%26title%3Des_estonia_no_francia%26page%3D1%26more%3D1%26c%3D1%26tb%3D1%26pb%3D1%26disp%3Dsingle&charset=%28detect+automatically%29&doctype=Inline&ss=1&outline=1&sp=1&verbose=1#skip]here[/url], and the error reported is:

Error Line 597, column 372: document type does not allow element "a" here .

...new Date()).getTime(); return false;"><img src="http://liberal-venezolano.net

Line 597 is:

document.write( ' <a href="#" onclick="document.getElementById(\'captcha_img_318bdf4f0f885ad9cc5300926b3debdd\').src = \'http://liberal-venezolano.net/blog/anarco/call_plugin.php?plugin_ID=8&amp;method=display_captcha&amp;params=a%3A1%3A%7Bs%3A6%3A%22pubkey%22%3Bs%3A32%3A%22318bdf4f0f885ad9cc5300926b3debdd%22%3B%7D&amp;reload=\'+(new Date()).getTime(); return false;"><img src="http://liberal-venezolano.net/blog/rsc/icons/reload.png" border="0" align="top" width="16" height="16" alt="Reload" title="Reload image!" class="middle"/></a>' );

Any idea on how to fix this?

2 Sep 06, 2006 14:12

Well, if you changed the </a> with a <\/a> it will validate but I don't know what else it might break in the captcha plugin .

3 Sep 06, 2006 14:44

Try this :-


<script type="text/javascript">
//<![CDATA[
......
......
//]]>
</script>

¥

4 Sep 06, 2006 15:45

Great! It works (The CDATA trick). It validates and it reloads the image as intended.

Thanks!

5 Sep 07, 2006 00:45

I've fixed it in SVN. Thanks for being anal.. ;)


Form is loading...