Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to include client side JavaScript in ssjs in xpages

I would like to include some results from client side JavaScript (csjs) into my server side JavaScript (ssjs) in XPages.

e.g. on csjs i collect the screenwidth of a device via window.screen.availWidth

I would like to use the result further in my ssjs. How can I do this?

like image 492
Patrick Kwinten Avatar asked Dec 04 '25 19:12

Patrick Kwinten


1 Answers

You need to send the screen width and height from you client script to you server script.

using QueryString (location.href=...../?open&width=xxxx&height=yyyyy), setting a field on your xpage and to a partialrefresh or using extlib remote service.

There are probably several more ways of doing it ;-)

like image 185
Fredrik Norling Avatar answered Dec 07 '25 07:12

Fredrik Norling