(Tutorial) Drupal 6 Basic Javascript w/ jQuery

DRUPALRANCH Newsletter:

Tutorial : Drupal 6 Basic Javascript w/ jQuery

Here at SOTC we have been working with Drupal as of late where we are working on updating our site. One of things that I couldn't find a whole lot of documentation on it is getting simple basic Javascript stuff working in Drupal 6. So to get people moving in the correct direction I decided to throw out a small tutorial on this, especially since Drupal 6 has built in support for jQuery, a Javascript library - which should make adding fancy stuff pretty easy.

Below we have a small mock-up of what we are going to build using jQuery and Drupal. A very simple table where the data rows will change style when hovered over and out. This is about the as basic as it gets with jQuery - so good for us :) I need to warn you though the source code for the live example on this page is not exactly what we do for Drupal. At the bottom of the post you can, however, download the source for the Drupal module that is being used - my very simple test module.

Engine Root Bulk Temp. (R) Mid Span Bulk Temp. (R) Tip Bulk Temp. (R)
CFM56 2250 2310 2295
GE90 2300 2322 2315
F404 2380 2399 2401
CF34 2108 2127 2118
TF39 2090 2106 2098

Ok starting off we are going to take a look at the basic code for the test module. My test module adds a new page which will hold our test content, in this case the page is /testmodule.

[Read more..]

Courtesy : Blog.paranoidferret.com



Tag Cloud