How do I call an SSJS method with parameters from javascript

老子叫甜甜 提交于 2019-11-29 18:36:56

You could do a XSP.partialRefreshPost in CSJS and use parameters to send your data to the server:

var p = { "key": getHashUrlVars()["key"] }
XSP.partialRefreshPost( '#{id:_element_to_refresh_}', {params: p} );

To access the parameters in SSJS just try this:

doStuff( param.key )

You could use an empty div-element as a target execute the SSJS code. Or you can use the executeOnServer - method: http://xpages.info/XPagesHome.nsf/Entry.xsp?documentId=88065536729EA065852578CB0066ADEC

Hope this helps

Sven

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!