We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

Script Function Available to BOTH Client side and Server side Code?

G24
Kilo Sage

Is it possible to write a JavaScript function, and make that function available to BOTH client-side and server-side code?

(I don't want to copy it and create a duplicate maintenance situation.)

 

How?  Where?  Thanks!

 

5 REPLIES 5

Hi, @Brad Bowman  I just want to call any arbitrary function like

  ReturnRandomColor();

  AddCommasToCurrencyStirng(anyCurrencyString)

  DoWhatever()

And I want to be able to call it directly from both server side code or client side code.  No AJAX.  No hoops.  No duplicate maintenance.