skip to main content

Library Routines : WD2$EXECJS

WD2$EXECJS
The WD2$EXECJS library routine executes JavaScript code. It can be used only in Web Direct 2.0 environment.
 
Note - if you use this routine to redirect the browser to a file created by the COBOL program (e.g. a PDF printed by the program) and you wish to specify a relative path to the file in your JavaScript, be aware that the relative path for the JavaScript doesn’t always match with the relative path used by the COBOL program. When you run your programs from the IDE the relative paths match between COBOL program and JavaScript. Instead, when you deploy your programs in a servlet container (e.g. Tomcat), JavaScript appends the relative path to the webapp main folder while the COBOL program appends them to the servlet container working directory.
Syntax:
 CALL "WD2$EXECJS" USING jsCode
Parameters:
Return code:
Examples:
Example - Show an alert message via JavaScript (this works only on WD2)
call "wd2$execjs" using "function display_alert(message) { alert (message); } display_alert('Hello world');"

Copyright (c) 2017 Veryant
Contact us
Please share your comments on this manual or on any
Veryant product documentation with the email button at the top left