top of page

Avoid Synchronous AJAX in Client Code

Synchronous AJAX calls in client-side code are a common cause of performance bottlenecks in web applications, including those built on ServiceNow. These calls block the user interface while awaiting responses from the server, leading to a poor user experience by causing significant delays. Moreover, synchronous requests can severely impact system scalability and overall application responsiveness.


Resolution Steps:

  1. Review client scripts for any use of synchronous AJAX methods such as getXMLWait() or g_form.getReference() that wait for server responses before continuing execution.

  2. Replace synchronous methods with asynchronous ones, such as using GlideAjax with callback functions. This allows the user interface to remain responsive while data is fetched in the background.

  3. Test for Functionality and Performance


Good Practice Example:

Asynchronous GlideAJAX
Asynchronous GlideAJAX

Transitioning from synchronous to asynchronous AJAX calls in ServiceNow client scripts significantly enhances the user interface responsiveness and application performance. By implementing these changes, developers can provide a smoother, more efficient user experience and better scale their applications.


For more detailed guidance on resolving this issue, please contact us at support@dt-advisory.ch.



bottom of page