jQuery Functional Test Suite

Say it in Smalltalk, Do it with jQuery

Counting Up and Down

Demo

Smalltalk

JQCounterFunctionalTest>>initialize
   super initialize.
   count := 0

JQCounterFunctionalTest>>renderContentOn: html
   html paragraph: [
      html anchor
         onClick: ((html jQuery: #count) load
            html: [ :h | h render: (count := count - 1) ]);
         with: '--'.
      html span
         id: #count;
         with: count.
      html anchor
         onClick: ((html jQuery: #count) load
            html: [ :h | h render: (count := count + 1) ]);
         with: '++' ]

Source

<>
  < =>--</>
  < =>0</>
  < =>++</>
</>
< =>/*<![CDATA[*/$("#id15").bind("click",function(){$("#count").load("/javascript/jquery/countingupanddown",["_s=E-1uVdNHpqhCjZw8","_k=Lb5ne1EWLEvOJxvX","14"].join("&"))});$("#id17").bind("click",function(){$("#count").load("/javascript/jquery/countingupanddown",["_s=E-1uVdNHpqhCjZw8","_k=Lb5ne1EWLEvOJxvX","16"].join("&"))});/*]]>*/</>