JavaScript 101: Getting Started (Part 2)

Follow @tristarweb

JavaScript is an easy scripting language to get started with. No extra programs or additional resources are needed to write JavaScript for a web design project. However there are many programs available to help programmers with their scripting, programs with code colouring and code suggestions are a real asset, but it is quite possible to get started using notepad or something similar. The only thing to keep in mind is your program of choice should be limited to displaying and storing only simple text,  you need to make sure that no text formatting is saved within the file format.

In web projects it is possible for JavaScript to be written in many places within your project file structure, it is  quite common to find script within the head tags or even within the mark-up itself. Although you can write JavaScript in the HTML page, and commonly see it, we will follow best practice and save all of our scripts as external files. This method has many advantages which includes:

  • Preserving your mark-up and keeping your JavaScript separate.
  • Its easier to organise external scripts.
  • Gives you the ability to reuse the same script across multiple pages and projects.
  • Its easier to read because your script is isolated and not scattered among other mark-up and scripting languages.
  • When you edit and save your external script it will carry across to all of the pages using that script without having to rewrite it for each.

Saving and writing you script as an external files is easy and in the next JavaScript 101 we will look at writing your first script, saving it as an external file and calling it in an HTML document.

About russell

Web Developer I’m a web developer with 3 years’ experience in the media industry.My Development skills includes flash, AS3, AS2, HTML, CSS, JavaScript, Jquery, XML, PHP, and MySQL. I have a great deal of experience developing interactive user interfaces in PHP Javascript AS3 AS2I have two masters degrees in Computer Science and Multi Media and before my current role I completed a year of research at De Montfort University researching multi touch technology. during this time I developed several multi touch applications for entertainment spaces.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Please wrap all source code with [code][/code] tags.

Follow Tristar on Twitter