[Seaside] Get the result of JS function
jtuchel at objektfabrik.de
jtuchel at objektfabrik.de
Tue Sep 22 06:05:25 UTC 2015
Thomas,
the JS function runs down in the web browser and returns its result
locally. So there is no easy way to get the results back to the server,
as far as I know. Calling the function can also only be accomplished
down in the Browser, e.g. by using events line onLoad etc.
What we usually do in Kontolino is to send such results back to the
server using an AJAX call.
It is not easy to provide sample code, because you don't exactly state
how and when you want a function to be called and such.
So just a hint:
we ship down JS code that hooks into Document.onload() from our
FileLibrary or external source (using html document addLoadScript:) and
instead of simply returning results we send an AJAX call to the server
to inform it about the results. The tricky part here is to give that
script a callback name to call back to.
Please ask for more specific info.
HTH
Joachim
Am 22.09.15 um 07:57 schrieb Thomas Heniart:
> Hi everyone,
>
> Is it possible to get the result after calling a JS function from Seaside
>
> For exemple I have a function in a JS file with a function test()
> which return true,
>
> Can we do something like
> result := html aMethod: 'test()'.
> which execute my function and get the result as a String in result ?
>
> Cheers,
> Thomas
>
>
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
--
-----------------------------------------------------------------------
Objektfabrik Joachim Tuchel mailto:jtuchel at objektfabrik.de
Fliederweg 1 http://www.objektfabrik.de
D-71640 Ludwigsburg http://joachimtuchel.wordpress.com
Telefon: +49 7141 56 10 86 0 Fax: +49 7141 56 10 86 1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20150922/305876bb/attachment.htm
More information about the seaside
mailing list