Hi Jon,

> In the upper part of the CHANGES file of the ongoing development
> version, there's a line saying "JavaScript 'lisp' calls. Can you
> explain what this is about?

Yes, this allows you to call a Lisp function on the server from
JavaScript on the client.

I used it to experiment with the Geolocation API, e.g.:

################################################################
(app)

(de setLocation @
   (msg (rest)) )

(action
   (html 0 "Geolocation" "@lib.css"
      (list
         (cons 'onload
            (text
               "navigator.geolocation.getCurrentPosition(function(pos) {
                  lisp('@1!setLocation', pos.coords.latitude, 
pos.coords.longitude);
               } )"
               *SesId ) ) )
      (form NIL
         (gui '(+Button) "Location") ) ) )
################################################################

This calls the function 'setLocation' whenever the button is pressed (or
the page is reloaded), effectively printing the coordinates on the
server side.

Cheers,
- Alex
-- 
UNSUBSCRIBE: mailto:[email protected]?subject=Unsubscribe

Reply via email to