Learn JavaScript Programming In One Day

By Shanna McNeil


Before starting to learn JavaScript, or any programming language for that matter, it is always a good idea to take a minute to understand what it is used for. Not to mention what kind of functionality it is capable of providing for in said application. For starters, readers should know that JS is one of the languages used by web browsers. To be more specific, it is a client-side programming language that is platform independent.

This means that a piece of JS code inserted into the HTML source code of a web page is automatically executed by the browser. It does not need to be compiled in order to be executed as a program. If this sounds too geeky or confusing, just ignore it and continue reading.

A static web page built using CSS and HTML can be made interactive using JS. A working knowledge of both HTML and CSS (as in web page design) is a prerequisite for anyone considering wading into JS. No prior programming knowledge is required, though, so this can be a good starting point for new programmers learning their first language.

Many people are also confused between JavaScript, Java and jQuery. Both JS and Java are OOPs (object oriented programming languages) with a lot of similarities in structure. However, JS is simpler and can be easily learned by following simple logic and syntax. JQuery is a library, which means it has prebuilt JS code which can be inserted into the script.

All that is really required to get started is a text editor and a web browser. There is no software to be downloaded and installed. It does not need a special compiler or programming environment. Just write the JS code in a text file, save it, and then open this file in the browser. That's all there is to it.

It might be easier to grasp by looking at a sample piece of code and testing it in a browser. The syntax could not possibly be any easier. The JS script will be the one inside the tag, which lets the browser know this is not a part of the HTML. Adding the type="text/javascript" attribute to the script tag indicates this script is a snippet of JS code.

The rest of it is mostly about learning how to create variables, arrays and objects, and assign values and properties to them. Try using all this in simple loops and conditional statements. It would be impossible in this short space to explain in more detail the logic behind object-oriented programming and the exact syntax used in JS. Let's just say that JS makes it a lot easier as compared to C, C++, or Java.

The next stage after that is to try more complex applications using jQuery and other libraries. These libraries have pre-coded functions that can be called from within the script, thus saving the time and effort required to code all of it from scratch. Anyone who is still reading and understood most of what has been said above should be able to learn JavaScript within a few hours.




About the Author:



ليست هناك تعليقات: