Skip to content

Instantly share code, notes, and snippets.

@jenter
Created December 8, 2016 16:01
Show Gist options
  • Save jenter/714cda2cf097563b5363a1771b99b841 to your computer and use it in GitHub Desktop.
Save jenter/714cda2cf097563b5363a1771b99b841 to your computer and use it in GitHub Desktop.
(function ($, Drupal, window, document) {
'use strict';
// Example of Drupal behavior loaded.
Drupal.behaviors.exampleJS = {
attach: function (context, settings) {
if (typeof context['location'] !== 'undefined') { // Only fire on document load.
console.log('This is loaded');
}
}
};
})(jQuery, Drupal, this);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment