dhtmlxAjax parametes length

Hi

i am trying to send data from client to server using dhtmlxAjax but when the parameters variable is a little bit longer than usual it does not work.

How can i specify the length of the parameters that i want to send to the server?

10x in advance

Hi,

Try to send POST request instead of GET:

dhtmlx.com/docs/products/dht … quest.html

i am using post.
here is a part of the code:

var vehiclesIdList = getVehiclesIdAsURLList();
        
        var params = "type=1&";
        params += vehiclesIdList;
        params +="&firmName=" + firmName;
        
        var url = "/SecurityHolding/OnlineServlet";
    
        dhtmlxAjax.post(url,params,function(loader)
        {
            var xmlDoc = loader.xmlDoc.responseXML;

            var markers = xmlDoc.documentElement.getElementsByTagName("marker");
            for(var i=0;i<markers.length;i++)
            {
                var vehicleId             = markers[i].getAttribute("vehicleId");
                var vehicleAlias          = markers[i].getAttribute("vehicleAlias");
                var lat                   = markers[i].getAttribute("lat");
                var lng                   = markers[i].getAttribute("lng");
                var date                  = markers[i].getAttribute("date");
                var time                  = markers[i].getAttribute("time");
                var parkingHours          = markers[i].getAttribute("parking");
                var parkingDate           = markers[i].getAttribute("parkingDate");
                var parkingTime           = markers[i].getAttribute("parkingTime");

the problem is that params variable string is very long and the library can not handle it. When i use jQuery or prototype i can specify the length of the data that i want to send and it works.

Now i want to do the same with dhtmlxAjax

POST doesn’t have limits. However, there can be server limitation. Or the problem can be caused by incorrect escaping of parameter. For example there can be special characters like & in parameters values. Therefore, parameters should be encoded. You may use encodeURIComponent to encode each parameter value.