People who code: we want your input. Take the Survey
3

In Drupal ajaxComplete() is not required, as Drupal executes each iteration of Drupal.behaviors.*.attach() whenever an ajax call is complete. This function receives an argument, context, which on page load contains the entire contents of the document, and on AJAX calls contains the new part of the DOM being inserted into the page. This piece of the document ...


1

For Drupal 8 you can do. /** * Implements hook_page_attachments(). */ function mymodule_page_attachments(array &$page) { $page['#attached']['drupalSettings']['myname'] = 'himanshu'; } (function ($, Drupal, drupalSettings) { /** * @namespace */ Drupal.behaviors.mymoduleAccessData = { attach: function (context) { var data = ...


Only top voted, non community-wiki answers of a minimum length are eligible