I’m getting started with JQuery

There used to be a time when I was a JavaScript God. I could blindly type any piece of code in the irt FAQ and could do some pretty neat stuff combining XML, ASP and Javascript.

However, years have passed, libraries evolved and AJAX came to the scene. I regularly read the most interesting developer blogs on these subjects but I have been endulged in many other technical and less technical IT subjects (mostly Siebel, Microsoft or Rational related).

So I set myself a goal to just pick one of these new awesome libraries and start working with it to bring myself again to a certain acceptable level on the new areas around JavaScript.

- I decided to begin with learning JQuery since I’ve heard good stories about this library (I have to start somewhere).
- I decided to write a certain application: an addressbook which does not use a database backend but stores all contacts as text files (so I can edit each contacts using TotalCommander :)).

So… I wrote a routine which displays a certain datafolder on my harddisk and shows the directories. Each of these directories is of certain type. E.g. it could hold families, companies, households, martians, linkedin contacts, hyves contacts or any ordering you want. The following image shows you my first draft tree:


The php application is 100% pluggable. Each field of a contact is a plugin. Each directory type is handled by a plugin and each report is a plugin. So a report is generated pretty dynamically independent of content. Below you see how I call $f_name to call a field plugin. The directory types HOUSEHOLD and CATEGORY are pasted in for explanation.

   1: while ($cCounter <= $sizeOfArray) {
   2:  $catname = $arr[$cCounter][CATEGORY];
   3:  echo '<td colspan="10" class="header">' . $catname . '</td>';
   4:  while ( ($arr[$cCounter][CATEGORY] == $catname) && $cCounter <= $sizeOfArray) {
   5:  $hhname = $arr[$cCounter][HOUSEHOLD];
   6:   while ( ($arr[$cCounter][HOUSEHOLD] == $hhname) && $cCounter <= $sizeOfArray) {
   7:     echo '<tr>';
   9:     for ($k=0;$k<(sizeof($settings));$k++) {
  10:       $f_name = $settings[$k] . '_row';
  11:       $o_name = $settings[$k];
  12:       if ($alternate==0) {
  13:         echo '<td>';
  14:       } else {
  15:         echo '<td style="background-color: #f4f4f4; font-family: Consolas, 'Courier New', Courier, Monospace; font-size: 8pt; line-height: 12pt;  border-style: none; color: black; overflow: visible; padding: 0px 0px 0px 0px; width: 100%; margin: 0em; background-color: white;">';
  16:       }
  17:       echo $f_name($arr[$cCounter][$o_name]) . '</td>';
  18:     }
  20:     echo '</tr>';
  21:     $cCounter=$cCounter+1;
  22:   } // while the same household
  23:   if ($alternate==1) {
  24:     $alternate=0;
  25:   } else {
  26:     $alternate=1;
  27:   };
   1: <script type="text/javascript">
   2:       $(document).ready(function(){
   3:         // first test for household
   4:         $("a").filter(".household")
   5:             .click(function(){
   6:               $.ajax({
   7:               url: "household.php",
   8:               cache: false,
   9:               success: function(html){
  10:                 $("#report").append(html);
  11:               }
  12:               });
  13:               return false;
  14:             })
  15:           .end()
  16:         });
  17:     </script>

Obviously this will not work since everything after the “comma” is also passed which means that this filter approach will not work also the ajax function does not pass these parameters.

Oh… I feel so N00b here. Such a simple question “how to pass two parameters in Jquery”… But… fun anyways! If anyone has a clue here please leave me a comment.

Links for 2007-09-19

NVIDIA Demo: Human Head

Why the Moon? | X PRIZE Foundation

Why Creationists Say There’s No Proof

Hominid Timeline – AndaBien
great timeline, you should see this one.

Evolution Timeline – AndaBien
give a good perspective on our life!

Bjorn Tipling’s stuff: Things to do when you’re a bored developer
really great list!

AlterNet: Blogs: PEEK: Atheist Soldier Sues Military for Discrimination
Atheist Soldier Sues Military for Discrimination

Pentagon Sued Over Mandatory Christianity
Pentagon Sued Over Mandatory Christianity

Coffee Drinks Illustrated | Lokesh Dhakar
great visual explanation of coffee drinks, this one goes in my home wiki

TIminoriHair.swf (application/x-shockwave-flash Object)
very cool flash full-person mousefollow girl

hoooooolllyyy wow!

Zaterdag 24 september: opening Woerdman Malden: interior decors


Next saturday my parents and the managers, after blood, sweat and tears during the relocation activities, will hold a reception for their new beautiful store in Malden. The location will be a complete one-stop location for interiors in the higher end of the market. Take a look at the website to get a feeling for the products and services they will offer. If you live near Malden and want to take a look at the exclusive wallpapers, paints, wooden floors, carpets, etc… the store offers, saturday is an excellent choice.

One thing that triggers me with some new ideas for my house are the online wallpaper books. Together with the advice from the experts in the store on combinations of paints, curtains and such you can create an excellent make-over for the decorations of rooms.

The full message:

Het is eindelijk zover, Woerdman is verhuisd 

Nieuw adres: Sluisweg 3a Malden – Heumen

image Na een periode van ca 9 jaar in het winkelcentrum Hatert is de winkel niet alleen uit zijn voegen gegroeid maar onze werkzaamheid is steeds meer veranderd. Van speciaalzaak in verf is het bedrijf steeds meer een totaalaanbieder geworden. Met ons professioneel assortiment Sikkens en Sigma verfproducten en een compleet aanbod van woninginrichting zien wij dan ook de toekomst met vertrouwen tegemoet.

Voor Woerdman betekent dit echter ook het afstoten van de dhz-verven en decoratieve accessoires zoals tafelzeil en plakfolie. Ook klein electra behoort niet meer tot het standaard assortiment van Woerdman. Wij verwachten hierdoor meer aandacht en tijd te kunnen besteden aan onze nieuwe activiteiten voor bedrijven en particulieren.

image De nieuwe locatie biedt meer verkoop- cq showruimte en meer opslagruimte. Ook is er dan voldoende ruimte om u uitgebreid advies te geven. Wij vinden het dus een uitstekende locatie om onze nieuwe activiteiten naar behoren te kunnen uitvoeren, zoals het presenteren en verkopen van buitenzonwering en palletverkoop van houten vloeren! Meer ruimte voor ons assortiment, bijvoorbeeld voor onze NMC-producten. Als dealer-grossier van NMC hebben wij de NMC-producten op voorraad. Meer assortiment en dus meer keuze voor u.

Als totaalaanbieder gaan wij onze advieswerkzaamheden vanuit de nieuwe vestiging in Malden ook uitbreiden van verwerkingsadviezen voor het schilderwerk tot en met complete stylingadviezen voor bedrijf en particulier.

Zoekt u een schilder,of behanger? Ook hierin kunnen wij behulpzaam zijn. U bent dan verzekerd van een goede verwerking met professioneel materiaal, tegen een concurrerende prijs.

Voor Nijmegen en omstreken is Woerdman in Malden zeker een aanwinst!

Lottery Synchronicity

Amazing synchronicity! On tuesday (11-9) I got an SMS that I won a price in the lottery, I checked and found I won €5.


However, the lottery number is …my birthday: 001606 (!), I think GR stands for greeting and someone was sending me a greeting (like the hacker inside the lottery system :)).