WHAT IS DIFFERENCE BETWEEN CLIENT AND SERVER-SIDE SCRIPTING?

Sidhu9
Tera Contributor

Thanks,

Srinu

Thanks& Regards
Sidhu !
1 ACCEPTED SOLUTION

Soumya Thareja1
Giga Expert

Hi Srinu,

You can differentiate the two based on a lot of factors like performance, business requirement, flexibility, scripting style, time taken to execute, and most importantly 'WHEN'. 
By when I mean, given a business requirement, when would you like your script to be triggered. Is it once the operation has been performed on the database. Like-

  • Update
  • Delete
  • Insert


In this case, you would like to go with Server-side scripting. Eg- Business Rules, Script Includes.


 If you want the script to be triggered based on the activities being performed on the browser (hover of the mouse over a field, change of a field value on the record, or on the load of the form, or an alert to be displayed before you click on Save/Update), in that case, you would go for Client side scripting. Like Client Scripts, UI policies etc. 


For a deeper understanding, you can go thru this blog


https://www.servicenowelite.com/blog/2014/2/19/client-vs-server

 

View solution in original post

4 REPLIES 4

Soumya Thareja1
Giga Expert

Hi Srinu,

You can differentiate the two based on a lot of factors like performance, business requirement, flexibility, scripting style, time taken to execute, and most importantly 'WHEN'. 
By when I mean, given a business requirement, when would you like your script to be triggered. Is it once the operation has been performed on the database. Like-

  • Update
  • Delete
  • Insert


In this case, you would like to go with Server-side scripting. Eg- Business Rules, Script Includes.


 If you want the script to be triggered based on the activities being performed on the browser (hover of the mouse over a field, change of a field value on the record, or on the load of the form, or an alert to be displayed before you click on Save/Update), in that case, you would go for Client side scripting. Like Client Scripts, UI policies etc. 


For a deeper understanding, you can go thru this blog


https://www.servicenowelite.com/blog/2014/2/19/client-vs-server

 

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Srinu,

In terms of ServiceNow there are different scripts for client and server side

Client Side - These run when form loads etc or any field changes

Run JavaScript on the client (web browser) when client-based events occur, such as when a form loads, after form submission, or when a field changes value.

a) Client Script

b) UI Policies

c) UI Scripts

Server side -  These run when user does interaction and updated record or inserts or deletes.

Server scripts run on the server or database. They can change the appearance or behavior of ServiceNow or run as business rules when records and tables are accessed or modified.

Server-side Glide APIs (Application Programming Interfaces) provide classes and methods that you can use in scripts to perform server-side tasks.

refer below links for more details

Client-side scripting

CLIENT AND SERVER-SIDE PROGRAMMING

Server-side scripting

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Sree Vidya Medu
Kilo Contributor

The scripts can be written in two forms, at the server end (back end) or at the client end (server end). The main difference between server-side scripting and client-side scripting is that the server side scripting involves server for its processing. On the other hand, client-side scripting requires browsers to run the scripts on the client machine but does not interact with the server while processing the client-side scripts

Server-side scripting languages:

After the advent of CGI, multiple programming languages were evolved such as PHP, Python, Ruby, ColdFusion, C#, Java, C++ 

Client-side scripting:

The effective client-side scripting can significantly reduce the server load. It is designed to run as a scripting language utilizing a web browser as a host program. For example, when a user makes a request via browser for a webpage to the server, it just sent the HTML and CSS as plain text, and the browser interprets and renders the web content in the client end.

drakebohan
Kilo Explorer

These two terms are used in the context of web and have many differences, including different purposes and programming languages. Client side and server side are terms that both indicate how and where code runs. Client side programming includes any coding or computation or effects or animation or any sort of interaction your website performs with the user via browser . But server side programming is that which performs all the task in the server only . So the user is unaware of that. Few years ago JavaScript compilers were available only on the client machine (browsers). So java script was called as a client side scripting language. On the client side JavaScript is run by v8 engine (Google chrome). But now in the server side also JavaScript is used. The v8 engine (with some modifications to provide the server functionality) is also used in the servers to run js codes. So, in both cases the language is the same, only the environment is different.