O'Reilly logo

Mastering ServiceNow - Second Edition by Martin Wood

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Running client-side scripts

It would be inappropriate to have any chapter on client-side JavaScript without having a Hello, world! example at some point.

ServiceNow has a very simple JavaScript executor that is the equivalent of Background Scripts, but for the browser. On almost any page, pressing Ctrl + Shift + J will launch the JavaScript execution window:

Running client-side scripts

Let's run some code:

alert('Hello, world!'); 

Once you press the Run my code button, you should see the little pop-up alert box, as you may expect.

Your web browser executes the very simple JavaScript that you put in the window. Virtually every browser has a JavaScript console that provides the same ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required