我的代码
在1.4下面正确执行,在1.5下面错误, 要怎么修改?function CreateGoods_extattr_talbe2() {
            if (eat_id > 0) {
                $.ajax({                    
                    type: 'POST',
                    contentType: 'application/json',
                    url: 'http://localhost/test/WebService/Goods.asmx/Creategoods_extattrTable',
                    data: '{eat_id:' + eat_id + ',good_id:' + good_id + '}',
                    dataType: 'json',
                    cache: false,
                    success: function(result) {
                        $('#goods_extattrTable').html(result.d);
                        //$("#ProductAttritue .tabs").tabs("#ProductAttritue div.panes > div");                    },
                    error: function(XMLHttpRequest, textStatus, errorThrown) {
                        alert(XMLHttpRequest["responseText"]);                    }
                });            } else {
                $('#goods_extattrTable').html('');            }        }

解决方案 »

  1.   

    没碰到过,用FireBug调试一下有木有? 任何的错误提示有木有?好像JQ对json的要求比较严格'{eat_id:' + eat_id + ',good_id:' + good_id + '}'{"key": "string", "key2": 1} key要用“”引起来。
      

  2.   

    firebug 调试的时候 直接跳到   error: function(XMLHttpRequest, textStatus, errorThrown) {
                            alert(XMLHttpRequest["responseText"]);
    这里执行了
      

  3.   

    试着在 你的 键值添加 单引号 如:{'eat_id':'1','good_id':'1'}
      

  4.   

    我用 最新的 json2 生成的json 字符串 里 数字也是不加引号的