douhuike3199 2013-04-30 09:03
浏览 28
已采纳

too long

I'm validating my pages through http://validator.w3.org/ and only 4 errors were found, but in the same statement. and is to do with the div classes inside the brackets. Can anyone please help?

Thank you so much.

<script language="javascript" type="text/javascript" >

$(function(){
    $("#ContactForm").submit(function(){
        $("#submitf").value='Please wait...';

        $.post("process.php?send=comments", $("#ContactForm").serialize(),
        function(data){
            if(data.frm_check == 'error'){ 

                    $("#message_post").html("<div class='errorMessage'>ERROR: " + data.msg + "!</div>"); 
                    document.ContactForm.submitf.value='Resend >>';
                    document.ContactForm.submitf.disabled=false;
            } else {
                $("#message_post").html("<div class='successMessage'>Thank you. We'll be in touch shortly.</div>"); 
                $("#submitf").value='Send >>';
                }
        }, "json");

        return false;

    });
});

</script>
  • 写回答

1条回答 默认 最新

  • 普通网友 2013-04-30 10:23
    关注

    The XHTML 1.0 Recommendation itself says, in Compatibility Guidelines, item C 4: “Use external scripts if your script uses < or & or ]]> or --.” The reason is that by XHTML rules, script element content is parsed by normal rules, so those characters are or they may be markup-significant.

    Using &lt; for < etc. would fix this as regards to processing XHTML by the book, including general XML processing. But you probably intend to throw your page at various web browsers, and they will generally not do such processing but will handle the page as if it were HTML, and then things would fail.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥30 Unity接入微信SDK 无法开启摄像头
  • ¥20 有偿 写代码 要用特定的软件anaconda 里的jvpyter 用python3写
  • ¥20 cad图纸,chx-3六轴码垛机器人
  • ¥15 移动摄像头专网需要解vlan
  • ¥20 access多表提取相同字段数据并合并
  • ¥20 基于MSP430f5529的MPU6050驱动,求出欧拉角
  • ¥20 Java-Oj-桌布的计算
  • ¥15 powerbuilder中的datawindow数据整合到新的DataWindow
  • ¥20 有人知道这种图怎么画吗?
  • ¥15 pyqt6如何引用qrc文件加载里面的的资源