Firebug Console
Shows:
- output of your commands
- affected DOM elements
- syntax errors
12
Add to Drupal
‣ Enclose the commands in “ready” function
$(document).ready(
function() {
$(‘p’).hide(‘slow’);
});
13
Add to Drupal
‣ Save in a file in /yourtheme/scripts/file.js
‣ In template.php:
drupal_add_js(path_to_theme().‘file.js’, ‘theme’, ‘header’);
‣ (Optional) Use logic to specify when to call
otherwise it will be called on all pages.
‣ jQuery loaded automatically when you use
drupal_add_js().
14
Resources
‣ http://docs.jquery.com
drupal_add_js API Reference
‣
‣ http://learningjquery.com
‣ Hacking Digg.com with Firebug
15
1–3 of 3 previous next Post a comment