Mercurial > hg > mpiwgzen_wide
comparison js/README.txt @ 0:a3750d724105 default tip
initital
author | Dirk Wintergruen <dwinter@mpiwg-berlin.mpg.de> |
---|---|
date | Tue, 02 Jun 2015 09:16:36 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:a3750d724105 |
---|---|
1 Your theme can add JavaScript files in two ways: | |
2 | |
3 1. To add a JavaScript file to all pages on your website, edit your sub-theme's | |
4 .info file and add a line like this one: | |
5 | |
6 scripts[] = js/my-jquery-script.js | |
7 | |
8 2. To add a JavaScript file depending on a certain condition, you can add it | |
9 using some PHP code in a preprocess function: | |
10 | |
11 drupal_add_js(drupal_get_path('theme', 'THEME_NAME') . '/js/my-jquery-script.js', array('group' => JS_THEME)); | |
12 | |
13 For the full documentation of drupal_add_js(), see: | |
14 http://api.drupal.org/api/function/drupal_add_js |