简体   繁体   中英

saving large size json string using ajax,jquery ,java

I am calling server side method using jQuery AJAX and I am sending json string to controller . When the json size is small it is working well but when json size increases (say more 7.kb) it is not accepting json string from server side.

I think there is limitation in return size in jQuery AJAX method, can anybody help me to overcome this problem or suggest any alternate option to to send large js

My client side code is like,

$.ajax({
            url : 'savingurl.json',
            method : 'post',
            data : {
                jsonStr : jsonStr
                },
            success : function(data){
                         alert("success");
            }
        });

In above my success function is not getting executed when there is more data in jsonStr but when there is less data, it is executing fine.

Thanks in advance.

Thank u all .. now its working fine . The problem was with ajax method ,

instead of method: in ajax put type: ,then it will take large data ..

$.ajax({
        url : 'savingurl.json',
      //  method : 'post',
         type : 'POST',
        data : {
            jsonStr : jsonStr
            },
        success : function(data){
                     alert("success");
        }
    });

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM