- including both of them to.info file
scripts[] = hello_world.js
stylesheets[screen][] = hello_world.css
- Adding a JavaScript file and a CSS file to a page
$path = drupal_get_path('module', 'hello_world');
drupal_add_js($path . '/hello_world.js');
drupal_add_css($path . '/hello_world.css');
drupal_add_js('alert("Hello World!");', 'inline');
drupal_add_css("body { color: #ffffff; }", 'inline');
0 Comment(s)