Skip to content

Instantly share code, notes, and snippets.

@martsie
Created January 25, 2017 11:00
Show Gist options
  • Save martsie/f18a2fa307729cb7fc7b9b6814c7e030 to your computer and use it in GitHub Desktop.
Save martsie/f18a2fa307729cb7fc7b9b6814c7e030 to your computer and use it in GitHub Desktop.
Example of Drupal 7 ajax callback command in jQuery scope
/**
* Changes the page title. Can be called from Drupal AJAX commands using ajax_command_invoke().
*/
(function ($) {
$.fn.changePageTitle = function(pageTitle) {
document.title = pageTitle;
};
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment