0

When put string in function about(3000 character) all work fine, but when string is (10 000 character and more) function not working.

All string work fine when call trough webservice URL in browser.

function callJsonSync(userName, procedureName, jsonCallBackFunc) {
    $.ajax({

        crossDomain: true,
        type: "GET",
        contentType: "application/json; charset=utf-8",
        async: false,
        url: "webService/appws.asmx/myService?callback=?",
        data: { userName: userName, procedureName: procedureName },
        dataType: "jsonp",
        jsonpCallback: jsonCallBackFunc,

        error: function (xhr, textStatus, errorThrown) {
            alert(testStatus + ' - ' + errorThrown + ' - error- ' + procedureName)

        }
    });
}

Is there a limit to the length?

user_odoo
  • 2,284
  • 34
  • 55
  • duplicate of http://stackoverflow.com/questions/2659952/maximum-length-of-http-get-request – Dmitriy Mar 10 '16 at 10:36
  • `contentType: "application/json; charset=utf-8",` — Don't do that. The data you are sending is not JSON (and since you are making a GET request it isn't in the request body which is what the content-type describes anyway). – Quentin Mar 10 '16 at 10:44
  • `async: false,` — Don't do that. Synchronous requests are horrible, the feature has been deprecated on XHR, and you are using JSONP which doesn't support them anyway. – Quentin Mar 10 '16 at 10:44
  • @Quentin I'm remove contentType and async:false but again long string it does not work – user_odoo Mar 10 '16 at 10:53
  • @user5109824 — No, they aren't related to the problem (hence comments and not answers) they just make no sense at all. – Quentin Mar 10 '16 at 11:10
  • @Quentin I don't have idea what to do... – user_odoo Mar 10 '16 at 11:16
  • There is no way to send that much data over JSONP. Don't use JSONP. – Quentin Mar 10 '16 at 11:17
  • @Quentin What do you suggest? – user_odoo Mar 10 '16 at 11:21
  • XMLHttpRequest (i.e. what jQuery does if you don't force it to use JSONP) and a POST request. – Quentin Mar 10 '16 at 11:22
  • @Quentin Tnx for help, if you have any simple example please send me link....the best way to send data from localStorage to webService... – user_odoo Mar 10 '16 at 11:26
  • @Quentin With XMLHttpRequest I'm send max 1969 character... – user_odoo Mar 14 '16 at 12:49

0 Answers0