Hi David,

> If I load the app by going to localhost:8080 I see the button and can click
> on it but nothing happens and the button becomes disabled.  If I then
> refresh the page (it now has a long session string in the address bar) the
> button is enabled and I can click on it, the desired Alert dialog pops up
> working correctly.

Indeed, this is a known problem.

The reason lies with the "same server orgigin" policy of JavaScript's
XMLHttpRequests. Because PicoLisp uses a separate HTTP port for each
session, JavaScript (wrongly) believes this is a new server, and refuses
to execute :(

> How can I get the button to work the first time without reloading the page?

The right way to handle this is to run web applications in combination
with 'httpGate'. The best way is to start (as user 'root')

   /usr/lib/picolisp/bin/httpGate 80 8080

and (if you like to use HTTPS)

   /usr/lib/picolisp/bin/httpGate 443 8080 <path-to-PEM>

I have similar lines in my "/etc/rc.local" file. For a local
installation, adjust the pathes to 'httpGate' accordingly.

With httpGate you also have the advantage that you don't need to specify
":8080" in the browser (and that you can use HTTPS, of course).

♪♫ Alex
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to