[Seaside] How to get JavaScript parameters to Seaside Backend?

webmail at pielka.de webmail at pielka.de
Wed Jun 16 15:33:39 UTC 2010


I need the information about the size of the visible browser window in my Seaside application.
Seems that window.innerWidth and window.innerHeight can be used in JavaScript to detect this information.
I tried to get it back to Seaside with an Ajax call:

	html document addLoadScript: (
		html scriptaculous request 
			addParameter: ('windowInnerWidth=', 'window.innerWidth');
			addParameter: ('windowInnerHeight=', 'window.innerHeight');
			callback: [  
				windowInnerWidth := self requestContext request at: 'windowInnerWidth' ifAbsent: [  ].
				windowInnerHeight := self requestContext request at: 'windowInnerHeight' ifAbsent: [  ].
				Transcript show: windowInnerWidth; cr.
				Transcript show: windowInnerHeight; cr.

Unfortunately window.innerWidth is not evaluated before the Ajax request but is just handled as String:


What do I have to do to get the real values of window size?

Thanks and Best Regards,

More information about the seaside mailing list