Copyright

Web Scripting: Client-Side and Server-Side

An error occurred trying to load this video.

Try refreshing the page, or contact customer support.

Coming up next: Scripting Languages: Perl, JavaScript, VBScript & AppleScript

You're on a roll. Keep up the good work!

Take Quiz Watch Next Lesson
 Replay
Your next lesson will play in 10 seconds
  • 0:06 Web Scripting
  • 1:57 Client-Side Scripting
  • 4:06 Server-Side Scripting
  • 5:43 Comparison of Client-…
  • 7:12 Lesson Summary
Save Save Save

Want to watch this again later?

Log in or sign up to add this lesson to a Custom Course.

Log in or Sign up

Timeline
Autoplay
Autoplay
Speed Speed

Recommended Lessons and Courses for You

Lesson Transcript
Instructor: Paul Zandbergen

Paul has a PhD from the University of British Columbia and has taught Geographic Information Systems, statistics and computer programming for 15 years.

Web scripting is used to create dynamic web pages. Learn about the two types of web scripting used to make web pages more interactive: client-side and server-side scripting.

Web Scripting

Web pages are created using HTML, or HyperText Markup Language. Historically, web pages have been fairly static, consisting mostly of text and images. Modern web design, however, uses more interactive content. This can be as simple as changing the color of a button when someone moves their pointer over it to complex interactive online games. Web pages with interactive content are often referred to as dynamic web pages.

Dynamic content can be added to web pages using scripting. A script consists of a set of instructions that are executed under certain conditions. For example, if a user completes an online form, it is good practice to validate their entries. This is where scripting comes in. Web scripting uses small programs that are executed based on user interaction with a web page.

Scripting is widely used as part of web development. Web development includes all the efforts in developing a website for the Internet, including web design, web content development, network security configuration, and scripting. Scripting allows you to turn a simple, static HTML page into a more dynamic page. It makes it possible for users to interact with a website rather than just look at the pages.

Web scripts can run in one of two places: the client side, also called the front-end, and the server side, also called the back-end. The client refers to the web browser used to view a web page. The server refers to the computer server that hosts the website.

Client-Side Scripting

In client-side scripting scripts are executed on the local computer after you have loaded the web page. The script can be embedded within the web page or made available as a separate file. In both cases, the dynamic behavior is already part of the web page when you download it for viewing in your browser. When you interact with the web page in some way - for example, by clicking on a button or typing in some text - the script executes. The script is run on your local computer by the web browser software.

Consider a simple example. Let's say you are completing an online form, and you have to type in your phone number. Logically, that should only consist of numbers, and it may require a very specific format, such as this: 5552347890.

The form will not allow you to enter characters that are not numbers, and it will not allow you to use a different format. This is the result of a client-side script. The script responds immediately to your typing, checks your input, and provides a response before you actually submit the form. For example, it may tell you that the format is not correct.

Another example would be an online store where you have added a product to your shopping cart. You decided to change the number of items of one product from 2 to 4 and your total updates automatically. That is a client-side script at work. Client-side scripting is also used for animations, games and other types of dynamic content.

There are a number of languages for client-side scripting. JavaScript is by far the most popular, but ActionScript, DART and VBScript are also used. Because client-side scripts are part of the web page and run on the local computer, you can actually see their contents if you know where to look.

Server-Side Scripting

In server-side scripting, scripts are executed on the server before the web page is downloaded by a client. Consider the example of logging into your bank account online. You can go to the bank's homepage and fill in your username and password. Then you click the 'login' button. This sends a request to the server. The server checks your login credentials and pulls up your account information - this is when the scripts are run. The server then creates an HTML page to present you with your account details.

To unlock this lesson you must be a Study.com Member.
Create your account

Register to view this lesson

Are you a student or a teacher?

Unlock Your Education

See for yourself why 30 million people use Study.com

Become a Study.com member and start learning now.
Become a Member  Back
What teachers are saying about Study.com
Try it risk-free for 30 days

Earning College Credit

Did you know… We have over 200 college courses that prepare you to earn credit by exam that is accepted by over 1,500 colleges and universities. You can test out of the first two years of college and save thousands off your degree. Anyone can earn credit-by-exam regardless of age or education level.

To learn more, visit our Earning Credit Page

Transferring credit to the school of your choice

Not sure what college you want to attend yet? Study.com has thousands of articles about every imaginable degree, area of study and career path that can help you find the school that's right for you.

Create an account to start this course today
Try it risk-free for 30 days!
Create an account
Support