Web Design 101 - Part 4: Code - Client Side v. Server Side

Submitted by admin on Thu, 01/12/2012 - 11:00

Darkside of the web

As you explore the dark side of the web, you will find that most websites use some scripting other than HTML and CSS for an added boost.   Almost anytime a website asks for your interaction, you know that the site has been built with more than just HTML.  For example when you’re browsing the artwork gallery at JineenGriffith.com, you are seeing the results of some Javascript.  When you write a blog in your new CMS site you are seeing the results of PHP.  I’m not going to get into the technical details of these languages, but it’s interesting to know the basics of how they work.  When you hear the terms Client Side and Server Side Scripting, you will know what they mean.

Client Side Scripting

Javascript is a Client Side Script, which means that once your browser loads a Javascript program it does not have to access the server when an event (such as clicking the submit button on a form) occurs.  Javascript allows the programmer to create an interactive virtual environment for users.   While there are many other Client Side languages, Javascript is my favorite.  Interactive calendars, image galleries, drop-down menus, and forms all use Javascript.  

The term client-side means that the program (in this case the Javascript code) is attached as a file to your webpage.  When you load the page, the HTML accesses the Javascript by calling it.  Thus the Javascript is loaded in your browser and will stay there until you move on to another page. 

Server Side Scripting

The difference with Server Side Scripting is that when you trigger an event, your browser must send that information back to the server in order to know what to do next. For example when you fill out the design brief forms on this website, you are triggering php script.  You enter your information and then hit submit.  Your information is sent to the server where it's saved in a database.  From there it gets formatted into an email and sent to me, so that I can read it.

Client-side scripting is useful because it uses your browser to load the program and can cut down substantially on load and reaction time because the browser doesn’t have to communicate with the server before taking action.  The downfall with client-side scripting is that it can’t access any of the data that is stored on the server.  For example, a website that sells shoes will have a database of their entire inventory on their server.  In order to access the inventory, the programmer must use a server-side script.

 

copyright Dirt Bird Productions 2011 | Site Design and Development Dirt Bird Productions 2011