Hi Alex,

 > 1) How can you know how many (and which) variables that the request

The server part anyway must know which variables are relevant (can be
expected to be filled by the client). If you cannot guarantee that all
variables are filled by the client, I would simply clear them after
serving a request.

You're right.

 > 2) Setting up the URL data to be used in the jQuery.getJSON call will be a
 bit more work, as instead of writing data={*X=11, *Y=22} you have to do

Because the '*' is giving problems?

Yes, but ...

Then it is perhaps better to use simple variable names like {x=11, y=22)
and retrieve the values as (get 'x 'http) -> 11

- Alex

I didn't really read the last sentence of your previous mail, about the property 'http'. Now I know how to use it. ;-)
If I set up the input data for the getJSON call like this:

data = {Y: "Y-value", Z: 333};
data["*X"] = 111;

.. then I can handle the request in Pico Lisp like this:

(de json ()
   (httpHead "text/plain; charset=utf-8")
   (ht:Out T
      (ht:Prin *JsonCallback
         "({X:'" *X "', Y:'" (get 'Y 'http) "', Z:'" (get 'Z 'http) "'});") ) )

This works very well. Thanks a lot!


Reply via email to