<script language="JavaScript">
<!--
var obj = {"ee:ee":"ttttt","111":"2222"} 
alert(obj["ee:ee"])
//-->
</script>

解决方案 »

  1.   

    如果 [ 等符号是在 串用出现,是没有影响的.不必要转义 ep:
    <script type="text/javascript" src="http://www.json.org/json.js"></script><script type="text/javascript">
    var a="test[554";
    b={"a":a};alert(b.toJSONString());</script>
      

  2.   

    只要你读取属性不用obj.属性 用obj.[属性] 读取键值
      

  3.   

    不会影响,{}会被解析为对象,[]会被解析为数组,另外你的这个语句有点问题,应该是{"eeee":"ttttt","111":"2222",date : [{"wwww":"4444"},{"wwww":"6666"}]},date后面掉了一个":" 
      

  4.   

    <script type="text/javascript">var JSON = function(sJSON){
        this.objType = (typeof sJSON);
        this.self = [];
        (function(s,o){for(var i in o){o.hasOwnProperty(i)&&(s[i]=o[i],s.self[i]=o[i])};})(this,(this.objType=='string')?eval('0,'+sJSON):sJSON);
    }
    JSON.prototype = {
        toString:function(){
            return this.getString();
        },
        valueOf:function(){
            return this.getString();
        },
        getString:function(){
            var sA = [];
            (function(o){
                var oo = null;
                sA.push('{');
                for(var i in o){
                    if(o.hasOwnProperty(i) && i!='prototype'){
                        oo = o[i];
                        if(oo instanceof Array){
                            sA.push(i+':[');
                            for(var b in oo){
                                if(oo.hasOwnProperty(b) && b!='prototype'){
                                    sA.push(oo[b]+',');
                                    if(typeof oo[b]=='object') arguments.callee(oo[b]);
                                }
                            }
                            sA.push('],');
                            continue;
                        }else{
                            sA.push(i+':'+oo+',');
                        }
                        if(typeof oo=='object') arguments.callee(oo);
                    }
                }
                sA.push('},');
            })(this.self);
            return sA.slice(0).join('').replace(/\[object object\],/ig,'').replace(/,\}/g,'}').replace(/,\]/g,']').slice(0,-1);
        },
        push:function(sName,sValue){
            this.self[sName] = sValue;
            this[sName] = sValue;
        }
    }var strA = '{eeee:"ttttt",111:"2222",date:[{"wwww":"4444"},{"wwww":"6666"}]}';
    var objA = new JSON(strA);
    alert(objA);
    alert(objA.eeee+'\n'+objA['111']+'\n'+objA.date);
    alert(objA.date[0].wwww+'\n'+objA.date[1].wwww);
    </script>
      

  5.   

    我找到问题所在了~~~我在value 里面加了1个\或3个\\\或5个\\\\\
    解析 就出了问题
    不知道有什么好的解析方法
      

  6.   

    replace成其他字符,之后再replace回来