Writing client-side scripts

concept australia Updated Sep 10, 2026 2 min read client-side-scripting-overview.md
Raw file servicenow.com

Write scripts that run JavaScript on the client (web browser) when client-based events occur, such as when a form loads, after form submission, or when a field changes value.

Client-side API reference

When writing client-side scripts, you use client-side JavaScript APIs to control aspects of how ServiceNow AI Platform is displayed and functions within the web browser. For information about available client-side APIs, see the Client API reference.

  • Client scripts
    Client scripts allow the system to run JavaScript on the client (web browser) when client-based events occur, such as when a form loads, after form submission, or when a field changes value.
  • UI scripts
    UI scripts provide a way to package client-side JavaScript into a reusable form, similar to how script includes store server-side JavaScript. Administrators can create UI scripts and run them from client scripts and other client-side script objects and from HTML code.
  • UI pages and macros
    Use UI pages to create custom pages for an application and UI macros for custom controls or interfaces.
  • AJAX scripts
    AJAX (asynchronous JavaScript and XML) is a group of interrelated, client-side development techniques used to create asynchronous Web applications.
  • Display field messages
    Rather than use JavaScript alert(), for a cleaner look, you can display an error on the form itself. The methods showFieldMsg() and hideFieldMsg() can be used to display a message just below the field itself.
  • General guidelines for client script design and processing
    Well-designed client scripts can reduce the amount of time it takes users to complete a form.
  • Client-side scripting for mobile
    Client scripting for mobile is identical to scripting for the web, with some exceptions. All new scripts must conform to certain guidelines. The following items are affected on the mobile platform: client scripts, UI policies, navigator modules, and UI actions.

Parent Topic:Scripting on the ServiceNow AI Platform

Related topics

Client API reference

Search documentation
Search document titles and file paths on the australia branch