我用Dreamweaver写代码。最近发现当编码用:<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>在<head>与</head>之间放的函数过多时,中文的界面就会乱码,数量少时显示又没问题,改为gb2312就行。不知道哪位碰到过没有?

解决方案 »

  1.   

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <script type="text/javascript" language="javascript">
    var test_obj = document.getElementsByName("queue_model"); 
    var temp_test = false; 
    for(var i = 0; i < test_obj.length; i++){ 
    if(test_obj[i].checked)

    var sex = test_obj[i].value; 
    temp_test = true; 
    break;
    }
    }
    function queue_model_fifo()
    {
    var xmlhttp1;
    if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
       xmlhttp1=new XMLHttpRequest();
      }else{// code for IE6, IE5
       xmlhttp1=new ActiveXObject("Microsoft.XMLHTTP");
      }
    xmlhttp1.open("GET","/cgi-bin/queuemodel_FIFO.cgi?t=" + Math.random(),true);
    xmlhttp1.send();
    }
    function queue_model_lifo()
    {
    var xmlhttp;
    if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
       xmlhttp=new XMLHttpRequest();
      }else{// code for IE6, IE5
       xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    xmlhttp.open("GET","/cgi-bin/queuemodel_LIFO.cgi?t=" + Math.random(),true);
    xmlhttp.send();
    }
    function update_chailman_num(){
    var xmlhttp;
    if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
       xmlhttp=new XMLHttpRequest();
      }else{// code for IE6, IE5
       xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    xmlhttp.open("POST","/cgi-bin/chailman_num.cgi?t=" + Math.random(),true);
    xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");//固定格式
    xmlhttp.send(document.getElementById("12").value);
    }function update_speak_num(){
    var xmlhttp;
    if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
       xmlhttp=new XMLHttpRequest();
      }else{// code for IE6, IE5
       xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    xmlhttp.open("POST","/cgi-bin/speak_num.cgi?t=" + Math.random(),true);
    xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");//固定格式
    xmlhttp.send(document.getElementById("13").value);
    }
    function queue_model_fifo()
    {
    var xmlhttp;
    if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
       xmlhttp=new XMLHttpRequest();
      }else{// code for IE6, IE5
       xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    xmlhttp.open("GET","/cgi-bin/queuemodel_FIFO.cgi?t=" + Math.random(),true);
    xmlhttp.send();
    }
    function queue_model_lifo()
    {
    var xmlhttp;
    if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
       xmlhttp=new XMLHttpRequest();
      }else{// code for IE6, IE5
       xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    xmlhttp.open("GET","/cgi-bin/queuemodel_LIFO.cgi?t=" + Math.random(),true);
    xmlhttp.send();
    }
    function queue_model_lifo()
    {
    var xmlhttp;
    if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
       xmlhttp=new XMLHttpRequest();
      }else{// code for IE6, IE5
       xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    xmlhttp.open("GET","/cgi-bin/queuemodel_LIFO.cgi?t=" + Math.random(),true);
    xmlhttp.send();
    }
    function queue_model_lifo()
    {
    var xmlhttp;
    if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
       xmlhttp=new XMLHttpRequest();
      }else{// code for IE6, IE5
       xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    xmlhttp.open("GET","/cgi-bin/queuemodel_LIFO.cgi?t=" + Math.random(),true);
    xmlhttp.send();
    }
    function queue_model_lifo()
    {
    var xmlhttp;
    if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
       xmlhttp=new XMLHttpRequest();
      }else{// code for IE6, IE5
       xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    xmlhttp.open("GET","/cgi-bin/queuemodel_LIFO.cgi?t=" + Math.random(),true);
    xmlhttp.send();
    }
    function queue_model_lifo()
    {
    var xmlhttp;
    if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
       xmlhttp=new XMLHttpRequest();
      }else{// code for IE6, IE5
       xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    xmlhttp.open("GET","/cgi-bin/queuemodel_LIFO.cgi?t=" + Math.random(),true);
    xmlhttp.send();
    }
    function queue_model_lifo()
    {
    var xmlhttp;
    if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
       xmlhttp=new XMLHttpRequest();
      }else{// code for IE6, IE5
       xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    xmlhttp.open("GET","/cgi-bin/queuemodel_LIFO.cgi?t=" + Math.random(),true);
    xmlhttp.send();
    }</script>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>无标题文档</title>
    </head><body>
    <p>队列模式:
      <input type="radio" name="queue_model" id="1" value="1" onclick="queue_model_fifo()"/>
      aaa 
      <input type="radio" name="queue_model" id="2" value="2" onclick="queue_model_lifo()"/>
      bbb
    </p>
    </body>
    </html>
    中间的代码是复制的,一预览就这样了。去掉其中任何一个function就好了。
      

  2.   

    新建了个文本,改为html格式,代码复制进去,预览好了!真是见鬼!散分!
      

  3.   

    把你的文件格式改成utf8。。另外你代码的前几行肯定不会像你预期那样 test_obj 一直都是空数组