我希望仅将 recaptcha 用于不支持 JavaScript 的浏览器。为此,我尝试使用<noscript>
如下所示的标签。
<!DOCTYPE html>
<html>
<head>
<title>recaptcha</title>
</head>
<body>
<noscript>
<?php
require_once('recaptcha-php-1.11/recaptchalib.php');
echo recaptcha_get_html('xxx');
?>
</noscript>
<p>Done</p>
</body>
</html>
使用http://validator.w3.org验证代码时,我收到以下错误:
Error Line 11, Column 11: The element noscript must not appear as a descendant of the noscript element.
<noscript>
Error Line 12, Column 147: The frameborder attribute on the iframe element is obsolete. Use CSS instead.
…WAABIZRfA-fKq8eVkFjK_F" height="300" width="500" frameborder="0"></iframe><br/>
我能做些什么来消除这些错误(至少是第一个)?另外,我是否最好检测 JavaScript 使用服务器端而不回显验证码?