用JSON格式传值时,js一直 报这个错误:Uncaught SyntaxError: Unexpected token)

 错误位置是:result=eval('('+result+')');

 原因:忘了在一般处理程序中添加一个输出代码: context.Response.Write(json);

 public override void ProcessRequest(HttpContext context)
        {
            this.context = context;
            context.Response.ContentEncoding = Encoding.GetEncoding("utf-8");//避免出现乱码
            //接收浏览器 get/post 过来的参数cmd
            string cmd = context.Request["cmd"].ToString();
            switch (cmd)
            {       
                case "getBrand": json = GetBrandList();
                    break;
            }
            context.Response.Write(json);
        }