As you have seen, using Alfresco JavaScript you write scripts which execute in your server, not at your client browser end. You cannot write user interactive JavaScript code such as alert, inputbox
, and so on. As a developer, this makes things a bit complex in terms of debugging and troubleshooting your code.
However, Alfresco comes to your rescue yet again.
There are two ways to debug your code.
Like other root level APIs, Alfresco provides a
logger
object which exposes two methods to log your debug code in your console logger.2. Using the JavaScript Debugger:
This is another advanced user interface Alfresco offers for debugging, which allows step-by-step execution and debugging in the JS code.