RJSC
Access
{{reader}}
Favourite Pages
{{pageEntry.pageName}}
Signed in as {{currentUser}} {{avatar}}
Sign Out
Sign In as Different User
{{currentUserExtraOptions}}
OpenForum
Actions
RJSC
Get Action
Remote Javascript Call
Parameters
code
Usage:
[/OpenForum/Actions/RJSC?code=transaction.getParameter("code");]
/OpenForum/Actions/RJSC?code=wiki.getDateTimeStamp();
Server Side Javascript for GET method
//OpenForum/Actions/RJSC/get.sjs
code = transaction.getParameter("code"); queueName = transaction.getParameter("queueName"); if( code===null ) { transaction.setResult(transaction.SHOW_PAGE); return; } try{ function println(message) { openForum.postMessageToQueue(queueName,message); } console = { log: function(message) { println(message); } }; println("Running"); code = ""+code; result = eval( code ); if(result) { result = {result: result}; } else { result = {result: "ok", message: "Script Completed"}; } println("Complete"); transaction.sendJSON( JSON.stringify( {result: result} ) ); } catch(e) { try{ println(e); } catch(e2){} transaction.sendJSON( JSON.stringify({result: "error",message: "Error:"+e+" on line "+e.lineNumber})); }
An error has occurred.
{{OpenForum.errorMessage}}
See technical details
×
Error details.
{{OpenForum.error}}
×
{{OpenForum.alert.title}}
{{OpenForum.alert.message}}
×