Last active
October 28, 2017 15:37
-
-
Save jduhls/fc3d220cdf0c7ce3ca4a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($, Drupal){ | |
// Our function name is prototyped as part of the Drupal.ajax namespace, adding to the commands: | |
Drupal.ajax.prototype.commands.custom_javascript_function = function(ajax, response, status) { | |
// The value we passed in our Ajax callback function will be available inside the | |
// response object. Since we defined it as selectedValue in our callback, it will be | |
// available in response.selectedValue. Usually we would not use an alert() function | |
// as we could use ajax_command_alert() to do it without having to define a custom | |
// ajax command, but for the purpose of demonstration, we will use an alert() function | |
// here: | |
}; | |
}(jQuery, Drupal)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment