Friday, February 29, 2008

Take the Arc Challenge in javascript

Using the browser history manager of the YUI library.

  • test
    First of all, just a test of the browser history manager.
  • said-simple
    A simple implementation. I don't get far to abstract the page transitions and state handlings.
  • said
    I tried to abstract them as possible as I can. Please see the following.


  • function q0() {return {x: $F("said")}};
    show(INPUT({type:"text",id:"said"}),BUTTON({id:"button"},"submit"));
    $("button").onclick = cont(q0,function(query) {
    var said = query["x"];
    show(A({id: "a", href:"javascript:void(0)"},"click here"));
    $("a").onclick = cont(null,function(query) {
    show(SPAN("you said " + said))})});

    If Javascript had the continuation, I could write more better one.

    No comments: