The people over at Listelog.com have created a great list of tips when using Jquery. Ranging from basic to intermediate, the use of these techniques serve as a framework for more efficient code, and intelligently structured source.  I’ve provided here snippets from two of the twenty-five and all may be seen here.

Use Firebug’s excellent console logging facilities

If you haven’t already installed Firebug then you really should. Aside from many other useful features such as allowing you to inspect http traffic and find problems with your CSS it has excellent logging commands that allow you to easily debug your scripts.

Here’s a full explanation of all of it’s features

Use IDs instead of classes wherever possible

jQuery makes selecting DOM elements using classes as easy as selecting elements by ID used to be, so it’s tempting to use classes much more liberally than before. It’s still much better to select by ID though because jQuery uses the browser’s native method (getElementByID) to do this and doesn’t have to do any of it’s own DOM traversal, which is much faster. How much faster? Let’s find out.

I’ll use the previous example and adapt it so each LI we create has a unique class added to it. Then I’ll loop through and select each one once.

Improve your jQuery – 25 excellent tips.

tell people
  • description
  • Digg
  • del.icio.us
  • Google
  • Reddit
  • StumbleUpon
  • Technorati
  • Facebook
  • TwitThis
  • Yahoo! Buzz
  • NewsVine
  • MySpace

leave a reply


translate it

EnglishItalianKoreanChinese (Traditional)PortugueseGermanFrenchSpanishJapaneseArabicRussianGreekDutchBulgarianCzechDanishFinnishPolishRomanianSwedishNorwegianFilipinoHebrewIndonesianLatvianLithuanianSerbianSlovakUkrainianVietnamese

nowPLEASEthis

TagSpace
.
tagspace widget plugin from Plexav and Ken Stein
FEED the NEED