CAD · Question #260
Which options are strategies for debugging client-side scripts? Choose 2 answers
The correct answer is B. g_form.addInfoMessage() D. jslog(). Client-side scripts in ServiceNow run in the browser, so only browser-accessible methods are valid for debugging. (B) g_form.addInfoMessage() is a client-side GlideForm API method that displays an informational message directly on the form, making it useful for outputting…
Question
Which options are strategies for debugging client-side scripts? Choose 2 answers
Options
- Ags.addErrorMessage()
- Bg_form.addInfoMessage()
- Cgs.log()
- Djslog()
How the community answered
(58 responses)- A2% (1)
- B95% (55)
- C3% (2)
Explanation
Client-side scripts in ServiceNow run in the browser, so only browser-accessible methods are valid for debugging. (B) g_form.addInfoMessage() is a client-side GlideForm API method that displays an informational message directly on the form, making it useful for outputting variable values during debugging. (D) jslog() is a ServiceNow client-side utility function that writes output to the browser's JavaScript log, which is accessible via the browser's developer console. Options A (gs.addErrorMessage()) and C (gs.log()) are server-side GlideSystem methods that execute on the server and are not available in client-side scripts.
Topics
Community Discussion
No community discussion yet for this question.