Reputation: 43949
page 1 and page 2.
Now for page 1 I want to load page1.js and page1.css and for page2 i want to load page2.css and page2.js.
How to do this in drupal?
Upvotes: 4
Views: 2118
Reputation: 13226
You can do this from a module:
function mymodule_init() {
if (request_uri() == 'path') {
drupal_add_js( // arguments );
drupal_add_css( // arguments );
}
}
http://api.drupal.org/api/function/drupal_add_js
http://api.drupal.org/api/function/drupal_add_css
Upvotes: 2
Reputation: 836
If you are not too comfortable diving into code, you can try using http://drupal.org/project/css_injector and http://drupal.org/project/js_injector, although Kevin and Ramon Araujo's answers are a more common practice :)
Upvotes: 0
Reputation: 1738
Please try using drupal_add_js and drupal_add_css
Note that you can use php tags inside your page, there you can call drupal functions and so on. Otherwise you can create your own Drupal module and be the master of everything ;)
Hope this helps,
Upvotes: 1