Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering ServiceNow

You're reading from   Mastering ServiceNow Unleash the full potential of ServiceNow from foundations to advanced functions, with this hands-on expert guide fully revised for the Helsinki version

Arrow left icon
Product type Paperback
Published in Oct 2016
Publisher Packt
ISBN-13 9781786465955
Length 656 pages
Edition 2nd Edition
Arrow right icon
Author (1):
Arrow left icon
Martin Wood Martin Wood
Author Profile Icon Martin Wood
Martin Wood
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface 1. ServiceNow Foundations 2. Developing Custom Applications FREE CHAPTER 3. Server-Side Control 4. Client-Side Interaction 5. Getting Things Done with Tasks 6. Events, Notifications, and Reporting 7. Exchanging Data – Import Sets, Web Services, and other Integrations 8. Securing Applications and Data 9. Diagnosing ServiceNow – Knowing What Is Going On 10. Packaging with Applications, Update Sets, and Upgrades 11. Making ServiceNow Beautiful with Service Portal and Custom Interfaces

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:

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 functionality, which you will probably prefer, but it is helpful that ServiceNow gives you a simple alternative for every browser.

Scope on the client

The JavaScript executor will always run code outside of any scope. But as we journey through the platform, we'll find several places where only certain functionality is allowed, just like the...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime