Can i write common code for 2 client scripts ?

abed_masrawa
ServiceNow Employee
ServiceNow Employee

Hi

I have 2 pages that have data from one table in the DB.

I want to write client script for the 2 pages.

Can i write 1 client script for the 2 pages ?   or to write the same script include twice ?

1 ACCEPTED SOLUTION

Script includes are for server side code libraries. UI scripts are the client side counterpart. You need to use a UI script to store your common code that you call from the various client scripts.


View solution in original post

12 REPLIES 12

Script includes are for server side code libraries. UI scripts are the client side counterpart. You need to use a UI script to store your common code that you call from the various client scripts.


thanks 🙂


You are welcome.



If I have answered your question, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.



If you are viewing this from the community inbox you will not see the correct answer button.   If so, please review How to Mark Answers Correct From Inbox View.



Thank you