Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/418.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 导致w3c验证错误的分隔符_Javascript - Fatal编程技术网

Javascript 导致w3c验证错误的分隔符

Javascript 导致w3c验证错误的分隔符,javascript,Javascript,我希望我的家中没有所有W3C错误。我还有最后一个错误: 以下是该错误的代码: if (ErrorFound == 0) { if (document.frmRegister.tbPassword.value.length < 8) { alert("Password must be at least 8 characters in length."); document.frmRegister.tbPassword.

我希望我的家中没有所有W3C错误。我还有最后一个错误:

以下是该错误的代码:

 if (ErrorFound == 0)
 {
      if (document.frmRegister.tbPassword.value.length < 8)
      {
           alert("Password must be at least 8 characters in length.");
           document.frmRegister.tbPassword.focus();
           ErrorFound = ErrorFound + 1
      }
 }
if(ErrorFound==0)
{
if(document.frmRegister.tbPassword.value.length<8)
{
警报(“密码长度必须至少为8个字符。”);
document.frmRegister.tbPassword.focus();
ErrorFound=ErrorFound+1
}
}
有什么想法可以让我保持相同的功能,但防止W3C错误

非常感谢,


Paul

您可以将脚本放在
CDATA
块中,这将导致XML解析器忽略它:

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

//

您可以将脚本放在
CDATA
块中,这将导致XML解析器忽略它:

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

//

这在中进行了描述。

这在中进行了描述。

或者您可以使用>代替,或者您可以使用>代替