new   Option(keyfield,valuefield)o大写

解决方案 »

  1.   


    所以整句应该是:
    document.getElementById("selectid").options.add(new   Option(keyfield,valuefield)); 
      

  2.   

    两个<script type="text/javascript">
    var to16 = {    on : function (str) {
            var a = [], i = 0;
            
            for (; i < str.length ;) a[i] = ("00" + str.charCodeAt(i ++).toString(16)).slice(-4);
            
            return "\\u" + a.join("\\u");
        },
        
        un : function (str) {
            return unescape(str.replace(/\\/g, "%"));
        }
        
    };alert(to16.on("\"请输\""));
    alert(to16.un("\\u0022\\u8BF7\\u8F93\\u0022"));
    </script>
    <script type="text/javascript">var toHTML = {    on : function (str) {
            var a = [], i = 0;

            for (; i < str.length ;) a[i] = str.charCodeAt(i ++);
            
            return "&#" + a.join(";&#") + ";";
        },
        
        un : function (str) {
            return str.replace(/&#(x)?([^&]{1,5});?/g, function (a, b, c) {
    return String.fromCharCode(parseInt(c, b ? 16 : 10));
    });
        }
        
    };alert(toHTML.on("\"请输\""));
    alert(toHTML.un("&#x22;&#x8BF7;&#x8F93;&#34;"));
    </script>