Client side scripting

This page is part of Ron Mertens' web page guides.

If you read the server side vs client side, you know that client side scripting means that you download code from the server, and then your browser executes this code. Usually this is done to perform things that plain HTML/CSS cannot do, like dynamic menus, special effects, etc.

Javascript

The main language used for client side scripting is Javascript, there's no question about it. Javascript looks a bit like C or Java, but it is a script - which means that your browser gets the full source code, and then executes it on demand.

Here is some sample Javascript code -

<SCRIPT LANGUAGE="JavaScript">
document.write('Writing stuff to the window...')
</script>

This code is written just inside your HTML file, and can print directly "into" the HTML file, like in this example. Obviously you can do more sophisticated stuff. You can build really complex applications using Javascript (Most of Google services, like Google Map, Calendar and GMail are written using Javascript).

Interacting with the web page and browser

One of the cool things in Javascript is that it can 'interact' with your browser, and with the current 'document'. Basically it means that you can change stuff in the page - like pick an image on the page and change it using code. That's how I do my random-image display in my travel page (Just refresh the page, and then you'll see different images).

What's next?

The next part in our guide is server side scripting.