Use jQuery selectors to locate and select elements on the page. jQuery selectors operate much like CSS3 seletors. Start out simple by selecting elements by tag, DOM id, or class name. Then get more advanced and select form elements based on their current state, and complex n-th child selectors. Additional notes: As a result of Drupal 7 using jQuery in no conflict mode, the jQuery object is not automatically assigned to the global $ symbol. The easiest way to get around this in Firebug or Webkit Inspector is to just use jQuery('element'); or do $ = jQuery; and then use the $ as per usual. If you take a look at the JS files in Drupal 7 you'll see that they almost all use an anonymous closure in order to assign the $ variable. Something like the following. (function ($) { // Add your code here and use $ as per usual. })(jQuery);
First look at basic fundamentals of jQuery's syntax and usage. Learn about using the $ function, jQuery selectors for finding elements on the page, creating new DOM elements, and browser detection. In addition to selecting elements on the page we'll introduce the basics of jQuery effects and events. Note: In D7 developers are encouraged to add a jQuery wrapper around JavaScript. (function ($) { // Original JavaScript code. })(jQuery);
When using Firebug console you need to use jQuery instead of $. >>> jQuery('.title')
Drupal 7 uses jQuery in no-conflict mode meaning you need to wrap your code in an anonymous function and pass the jQuery object into the function. This is a pretty common practice now days and is actually a better way to write jQuery in general rather than always assuming that jQuery is the $ symbol. But, it means in the console you need to use either jQuery('selector) or $ = jQuery;
Overview the Firebug extension for Firefox and how it can be used to aid in the development of Javascript. Real time development and debugging of Javascript.
What Is jQuery?
FreejQuery makes using Javascript easy. A description of the basic jQuery library, and a brief history of why jQuery exists and how it can be used to simplify development of Javascript for your site.
In its short history, jQuery has revolutionized front-end web development, making it faster, easier, and more rewarding to write JavaScript – allowing easier selection and manipulation of HTML elements, and ensuring that scripts work across the ever increasing landscape of browsers and operating systems.
Nate Haug and Jeff Robbins show many hands-on examples demonstrating how to use jQuery's simple syntax to choose and manipulate HTML elements, traverse the document object model (DOM), and to attach event handlers which can react to user interaction with the page.
In this video, Jeff and Nate introduce themselves and the agenda for this series, including Selectors, Effects, and AJAX.
Understanding Drupal
FreeLearn the essential terminology of Drupal in this overview of content nodes, blocks, theming, menu system and modules. In Understanding Drupal, the first in The Lullabot Learning Series, the Lullabot team provides an overview of Drupal as a content management system, as a PHP web application framework, and as a developer community. Its documentary-style exploration covers all the terminology and fundamental concepts for both site administrators and developers. If you've ever been confused by Drupal or are still trying to wrap your head around the community and platform, then this video is a roadmap to accelerate your journey up the Drupal learning curve. Topics include:
- How content is entered and managed
- How users and user permissions are handled
- What blocks are and what they can do
- The concepts and capabilities of Drupal's powerful module system
- How Drupal handles navigation and its menu system
- How themes alter the site layout, design, and presentation
- Site configuration and administrative messages and settings
This video uses Drupal 6 for examples, however it is more focused on general Drupal concepts rather than version-specific how-tos.