Learning Javascript

Posted in Articles

Tweet This Share on Facebook Bookmark on Delicious Digg this Submit to Reddit

Once you are comfortable using Photoshop and are knowledgeable in the fundamentals of HTML and CSS, you will be able to produce basic websites.

However, to provide greater interactivity to your websites, you should learn Javascript. Javascript is known as client-side scripting because it is code that is executed by the user’s web browser, which is known as the client in the client-server model.

You should think of it in the following way. HTML is the “structure” of your web page. CSS the is “presentation” of your web page. And Javascript is “behavior” of your web page.

Javascript allows for some dynamics effects on your web pages. Examples are menus that drop down or pull-out, and div content that appears or popup when user clicks on links, and text that fades in and out, and so on. HTML coupled with Javascript are also known as DHTML, where “D” stands for “dynamic”.

Javascript is a client-side language in that it is executed by the browser. As such, there are a few Javascript commands that are browser dependent.

Although not compiled, Javascript is a true programming language with conditionals branches and loops. You can even create custom Javascript objects. Javascript can be used to interact and to manipulate the Document Object Model (DOM) of the webpage.

Javascript is ideal for …

  • setting dynamic values in forms
  • redirecting webpages
  • displaying alert boxes and even accept user input
  • rollover effects

Although buttons with rollover states is best implemented using CSS, more complex state changes and remote rollover effect is often more suitably implemented using Javscript.

Javascript has an event model in which you can code “event handlers” so that certain code is executed whenever an event occurs — such as when an user hovers over or clicks on an page element, or when user changes a value on a form.

There are also even timer-based events.

Because Javascript is such a capable language, very rich user interfaces and interactions can be created.