JavaScript

Add Js

Submitted by shiv on Sun, 11/20/2016 - 11:30

Add a JS file to head from Module

  <?php /*  This will add a JS file to your head (specifically the $scripts variable in page.tpl.php)  */ 
drupal_add_js(drupal_get_path('type', 'module_or_theme_Name') . '/my_module.js');
?>

CDN / externally hosted libraries

Submitted by shiv on Mon, 06/27/2016 - 13:51

CDN / externally hosted libraries

You might want to use JavaScript that is externally on a CDN (Content Delivery Network) ? e.g. web fonts are usually only available using an external URL; you can't host them yourself.

Subscribe to JavaScript

Sample blackbox block

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas non porta odio, id mattis erat.

Nam sed tincidunt eros. Donec a venenatis odio, vitae commodo sem. Vivamus ullamcorper pellentesque erat, in adipiscing tortor scelerisque sit amet. Nulla pulvinar urna magna. Vivamus a ipsum lorem. Etiam adipiscing pulvinar lorem.