Hi again,

I would like to make a little Pico Lisp HTTP server that can handle XMLHttpRequests from jQuery.getJSON(...), and I wonder if I can use lib/http.l. If you don't know jQuery.getJSON, you can find some info and a nice little demo here: <http://docs.jquery.com/Ajax/jQuery.getJSON#urldatacallback>

It seems I've got a very tiny thing up and running, using lib/http.l. If my getJSON call in JavaScript uses an URL like "http://localhost:8080/@json?*JsonCallback=?";, and my server script does things like this

(de json ()
        (ht:Prin *JsonCallback "({x: 11, y: 22, z: 33});") )

.. then I've verified that I actually get the object {x: 11, y: 22, z: 33} back in my JavaScript. I'll try to make a small demo during the weekend.

As you may see from the above lines, I used a global variable *JsonCallback. I'd prefer my function json to use an input parameter instead, and from app.html#urlSyntax I get the impression that that should be possible. ("All arguments following the question mark are passed to that function.") I haven't figured out how to do that yet.

Have a nice weekend, everyone!


Reply via email to