Access Keys:
Skip to content (Access Key - 0)

Adding Functionality with JavaScript

Return to Drupal Cloud Landing Page

You can add Javascript to your Drupal Cloud site by putting it into a Block:

  1. From the Admin menu click Structure, then Blocks, then Add block.
  2. For the Block title, enter <none>
  3. For the Block description, enter a description of your choice, e.g. "Javascript: open external links in new window"
  4. Switch to Full HTML in the Text format drop-down.
  5. Click on Switch to plain text editor
  6. Place your Javascript between <script></script> tags.
  7. Fill in the Show block on specific pages section as needed and save the block.
  8. Activate the block by placing it in a Region, e.g. the Footer.

Drupal supports jQuery natively, so you can attach your jQuery function to behaviors:

(function($) {

Drupal.behaviors.functionName = {
attach: function() {
//function actions here
}
};

})(jQuery);

Return to Drupal Cloud Landing Page

IS&T Contributions

Documentation and information provided by IS&T staff members


Last Modified:

August 04, 2016

Get Help

Request help
from the Help Desk
Report a security incident
to the Security Team
Labels:
c-drupal-cloud c-drupal-cloud Delete
javascript javascript Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
Feedback
This product/service is:
Easy to use
Average
Difficult to use

This article is:
Helpful
Inaccurate
Obsolete
Adaptavist Theme Builder (4.2.3) Powered by Atlassian Confluence 3.5.13, the Enterprise Wiki