jQuery AJAX works but is there a way to pause something then action?

89 views Asked by At

I'm trying to get the auto sorting working which is it, it sets on the url when you load the page: blah.com/?sorts[date]=-1 but you then have to refresh the page for it to work, as it does not sort right away on page load.

  $.ajax({
       // Uncomment the following to send cross-domain cookies:
       //xhrFields: {withCredentials: true},
       url: $('#fileupload').fileupload('option', 'url'),
       dataType: 'json',
       context: $('#fileupload')[0]

   }).always(function () {
       $(this).removeClass('fileupload-processing');
   }).done(function (result) {
       $(this).fileupload('option', 'done').call(this, $.Event('done'), {result: result});
       $('.table-striped').dynatable({
           dataset: {
               files: result,
               ajaxData: {
                   sorts: { 'date': -1 }
               }
           }
       });
   });
0

There are 0 answers