<script language="JavaScript">
<!--
var obj = {
'name' : 'json'
,'age' : 19
,'sex' : 'men'
}
alert(obj.name)
//-->
</script>

解决方案 »

  1.   

    定义了一个javascript的对象,对象里面的属性值都是函数
      

  2.   

    js中没有包的概念。那样使用可以起到包的作用,可以减少命名冲突
    var fab = {
       createXMLHttpRequest:function(){
       }
    }
    因为createXMLHttpRequest完全成了fab的一个属性,外面再有同名
    方法也没有关系了
      

  3.   

    prototype中ajax对象下:ajax.Updater类有很好的解析!
    手上1.4的解析:
    为什么我们在上面的代码中不使用 var 关键字来声明这个变量呢(指 sayHi),因为那样做创建出来的函数将只是当前脚本块的一个局部变量(至少在 IE 中是这样)。不写 var 关键字,创建出来的对象的作用域就是我们所期望的 window。
      

  4.   

    定义一个对象,不是JSON序列(1楼reply有问题)。
    好处多着了,面向对象的封装性
      

  5.   

     Object Literals
    JavaScript defines an object literal syntax that allows you to create an object and specify its properties. An object literal (also called an object initializer) consists of a comma-separated list of colon-separated property/value pairs, all enclosed within curly braces. Thus, the object point in the previous code can also be created and initialized with this line:var point = { x:2.3, y:-1.2 };Object literals can also be nested. For example:var rectangle = { upperLeft: { x: 2, y: 2 },
                      lowerRight: { x: 4, y: 4}
                    };Finally, the property values used in object literals need not be constants; they can be arbitrary JavaScript expressions. Also, the property names in object literals may be strings rather than identifiers:var square = { "upperLeft": { x:point.x, y:point.y },
                   'lowerRight': { x:(point.x + side), y:(point.y+side) }};