Drupal 8: Running A Batch Through An AJAX Request
… = { attach: function attach(context, settings) { $.ajax({ url: Drupal.url('loading/ajax'), type: 'POST', contentType: 'application/json; … = NULL; // Create the batch_process(), and feed it a URL that it will go to. $url = Url::fromRoute('user.page'); $response = …