JavaScript Introduction

What is JavaScript?
JavaScript is a simple programming language that was adopted by the internet to help make websites more reactive to their users. JavaScript has nothing to do with Java which is owned by Oracle but originally developed by Sun Micro Systems. It does have a lot of similarity to the C/C++ language but isn’t as rigid in the definition of a variable.

What do I need to program in JavaScript?
When I started programming website the first application I used was Microsoft Notepad. This is really all you need to develop JavaScript applications but has no frills to help make your code build itself but I would recommend if your going this route to use Notepad++. There are many other programs that can help like Visual Studio from Microsoft which has a free version for individual developers. There is also Aptana which is a project based on eClipse which is also another developer environment that can be used.

What is really needed in a developer environment is code completion. This one feature helps reduce bugs as you create code. Just do a search on the internet and you should find many different reviews of applications that will build good JavaScript code.

Now that I have an application how do I run my code?
Now you have some code and want to see how it works there are a couple of ways to see how it works. The easiest way is to write a simple HTML file that will include your JavaScript code in the header of the HTML document. This is an example of an HTML file I’ve used to test my own code:

  <script type="text/javascript" src="mytestscript.js" />
  <div>Hello HTML</div>

Another way is to just put your code between a script tag and this embeds it directly in the HTML code. If you want to find how developers typically add JavaScript code to a webpage then just go to a webpage and look at its source, typically [CTRL]+[U] but is also dependent on the browser developer. Even though JavaScript is a complete language it will help that you also have a really good knowledge of HTML.

That is JavaScript in a nut shell. It is a very fun language to work with that can be fun to make more interactive web pages. There are also different projects that use JavaScript as a way of extending their application but these are more advance and specific topics.