Arc Forumnew | comments | leaders | submitlogin
6 points by hns 5920 days ago | link | parent

Server side Javascript with Helma and http://gobi.helma.at/Documentation/Developers/MarkupLib/:

  function said_action() {
    Html.form({
        callback: function() {
            var foo = req.data.foo;
            Html.link({
              callback: function() { res.write("you said: " + foo); }
            }, "click here")
        }, method: "post"},
      Html.Input({name: "foo"}), 
      Html.Submit()
    );
  }
Or, a bit more readable:

  function said_action() {
    var foo;
    var step1 = function() {
        foo = req.data.foo;
        Html.link({ callback: step2 }, "click here");
    };
    var step2 = function() {
       res.write("you said: " + foo);
    };
    Html.form({callback: step1, method: "post"},
      Html.Input({name: "foo"}), 
      Html.Submit()
    );
  }
This one actually uses callbacks stored on the server, like the Arc example.


1 point by chl 5919 days ago | link

Very nice! I had totally forgotten about MarkupLib's callback superpowers.

-----