这个是不ajax的错误 是后台代码出错了,只能在后台照原因。

解决方案 »

  1.   

    一看就是data,你服务器就发出这个data,
      

  2.   

    你的动态页返回200状态,标准json格式字符串就不会执行error回调至于你动态页加了try..catch容错配置客户端是扑捉不到的,你可以通过msg来判断success: function(msg)
    {
    if(msg.ajaxResult=='fail')alert('出错鸟'+msg.errorStack)
    else  console.log("ajax success");

                    console.log(msg);
    }
      

  3.   

    ===========================================================
         function Form(){
                jQuery.ajax({
                url: $("#Form").attr('action'),
                data: $('#Form').serialize(),
                type: "POST",
                timeout: 30000,
                success: function(msg)
                {
                    if(msg.ajaxResult=='fail')alert('出错鸟'+msg.errorStack)
                       else  console.log("ajax success");

                             console.log(msg);
                }========================================================加上楼主标红的判断代码,
    1.控制台显示是 ajax success
    2.还是报{"ajaxResult":"fail","errorStack":"java.lang.NullPointerException\n\tat
    ,"msg":null}
      

  4.   

     jQuery.ajax({
    dataType:'json',
                url: $("#Form").attr('action'),
                data: $('#Form').serialize(),
                type: "POST",
                timeout: 30000,
      

  5.   

    ===========================================================
         function Form(){
                jQuery.ajax({
                url: $("#Form").attr('action'),
                data: $('#Form').serialize(),
                dataType:'json',
                type: "POST",
                timeout: 30000,
                success: function(msg)
                {
                    if(msg.ajaxResult=='fail')alert('出错鸟'+msg.errorStack)
                       else  console.log("ajax success");

                             console.log(msg);
                }========================================================
    结果是
    出错鸟java.lang.NullPointerException  
      

  6.   

    那不就是出错了,然后输出错误信息。楼主你到底要干嘛。。NullPointerException
      

  7.   

    论坛中看到 ‘一般的NullPointerException的问题都是在跳转页面去取值的时候得到的是null值’,怎么理解呢
      

  8.   

    $('#Form').serialize()获得data数据等号后为空造成的,也许不应该采取serialize()方式获取。
      

  9.   

    alert($('#Form').serialize());
    检查一下表单数据是否取到
    还需检查数据格式是否符合服务端要求
      

  10.   

    ===========================================================
    var data = $('#submitForm').serialize();
         function Form(){
                alert (data);
                jQuery.ajax({
                url: $("#Form").attr('action'),
                data: $('#Form').serialize(),
                dataType:'json',
                type: "POST",
                timeout: 30000,
                success: function(msg)
                {
                    if(msg.ajaxResult=='fail')alert('出错鸟'+msg.errorStack)
                       else  console.log("ajax success");
                             console.log(msg);
                }========================================================
    获取表单数据,很多为空,且不是网页上填写的数据。
    我先手动输入data试试。
    等大神,提示更好的方法获取data
      

  11.   

    现在还有人用alert.
    你的目标数据是怎样的格式。
    你现在的数据又是怎样的格式。
    只能空想。