Sometimes the data that you’re passing back from the client is sensitive data which nobody should be able to read (including administrators).
One particular instance for this is if you are passing a password back to do validation.
Also, sometimes some GlideAjax’s you just do so many times, that it’ll clog up the logs and possibly cause performance issues with the constant writing.
The logs I am talking about here are the Apache Tomcat logs (https://instance.service-now.com/channel.do?sysparm_channel=logtail)
Give it a go, have one window open with the logs and in another window run a GlideAjax and watch the information that’s written to the logs.
There’s a very simple parameter which you can use to prevent this logging:
var ajax = new GlideAjax(‘glideajaxname’);
Adding that one parameter to your ajax calls will prevent it from being logged to the logs, reducing the number of writes to the disk (always good) but also securing and hiding bits of data which is being passed back.