JavaScript Function Library

T Pappu
Kilo Contributor

Hello all,

I have some standard JavaScript functions that i want to bundle them into a single repository/file instead of using them in the respective client scrips.

Question is, Is there a place/location where i can store all the standard JS functions so i can call them from any of my client/UI policies?

Thanks,

KP 

1 ACCEPTED SOLUTION

Infact, glide ajax serves as purpose to improve performance.

You can use async glide ajax as well.

 

Regards,

Sachin

View solution in original post

8 REPLIES 8

sachin_namjoshi
Kilo Patron
Kilo Patron

You can create script include to store all my JS library functions so that you can call them from client script using Glide Ajax.

Check below

 

https://community.servicenow.com/community?id=community_article&sys_id=9f7ce2e1dbd0dbc01dcaf3231f961...

 

Regards,

Sachin

Elijah Aromola
Mega Sage

Just as Sachin stated, the only way to do this is to have a script include that you call via glide ajax that contains all of your code. Unfortunately, there is not a client-side equivalent for this functionality. 

Tanushree Doiph
Mega Guru
Hi You can use script include for that purpose, using script include, you can call it anywhere that you want like server side (business rule) as well as client side (ui policy, client script) Please mark correct and helpful Thanks Tanushree

T Pappu
Kilo Contributor

Thanks for your answers.

Isn't Script Include for server development. So every time I want to call a client side javascript function, you are saying call the function which resides on the server side and ServiceNow needs to make a trip to server? Isn't that a performance bottleneck?