Skip to content

Js Tricks Drupal

Pierre Germain edited this page Feb 28, 2022 · 1 revision

Execute Js if page is loaded

  // Cambia font size en slider
  Drupal.behaviors.mymodule_loaded = {
    attach: function (context, settings) {

      // Only if page is loaded we want our script executed
      $.get(this.href, function (response) {
        console.log('Hello, this is after the page is loaded');
      });
    }
  };

Clone this wiki locally