Arc Forumnew | comments | leaders | submitlogin
2 points by edw 6034 days ago | link | parent

Now, slightly longer, but emits real XHTML and uses AJAX to place the result in the DOM:

    (define-handler (said)
      (page
       "Arc Challenge"
       (form (message)
             `(,(field message) ,(submit "Go"))
             (page "Almost"
                   (ajax-link "Click here" 'message
                              `(p "You said: " ,message))
                   `((div id message))))))


2 points by edw 6033 days ago | link

Now, slightly shorter, more clear, is AJAXian from start to finish:

    (define-handler (said)
      (page
       "Arc Challenge"
       (ajax-form 'output (message)
                  `(,(field message) ,(submit "Go"))
                  `(p
                    ,(ajax-link "Click here" 'output
                                `(p "You said: " ,message))))
       '((div id output))))

-----