zilcuanu
zilcuanu

Reputation: 3715

Jquery Datatables passing extra parameters while making Ajax call

I am using Jquery Datatables to populate some data from the server. Below is the code I am using.

          var table = $(function  ()  {
           var table=$('#dataTable').dataTable( {
              "jQueryUI": true,
              "dom": 'T<"clear">lfrtip',
              "sPaginationType": "full_numbers",
              "sAjaxSource": HOST_NAME+"/states/",
              "sAjaxDataProp": "content",
              "bFilter": true,
              "oSearch": {"bRegex":true, "bSmart": false},
           });
           var tt = new $.fn.dataTable.TableTools( table );
         });

But during the ajax call I see an extra parameter http://myserver.com/states?_=1410160127424. I do not want to send the __=1410160127424 parameter since I am using varnish to cache the data. How to override the default implementation to restrict the extra parameter in the url.

Thanks

Upvotes: 1

Views: 705

Answers (1)

davidkonrad
davidkonrad

Reputation: 85528

jQuery dataTables are using jQuery AJAX. So simply change the default settings for AJAX sessions :

$.ajaxSetup({ 
   cache: false 
});

Upvotes: 2

Related Questions