D1J1T Article Categories:

Programming   Management   Development   Design   HTML   JavaScript   CSS   PHP   MySQL   Database   Server   Audio   Object-oriented Programming   Hosting   Mobile   Social Networking   Java  

JavaScript Overview

Function, anyone?

by D1J1T — in JavaScript — Updated: Feb 9, 2015 at 1:27 pm

Not to be mistaken with Java, JavaScript is not a stand-alone language. Rather it is typically embedded and used with other languages (most often with HTML & CSS).

Though it has server-side applications, most often, JavaScript is used on the client-side and for manipulation of the DOM (Document Object Model). JavaScript is object- oriented and can select/target elements in order to alter them in real time as the user interacts with the site.

JavaScript has become so very popular that numerous frameworks/libraries have been developed to extend it and enhance its ease of use. (jQuery is becoming more and more a common buzzword in the field.) Along with the HTML5 canvas and CSS3, JavaScript can produce animations comparable to Flash. It would be considered the main machine behind the animation/functions. (Though CSS3 can produce simple animation alone as well)

JavaScript allows for better interaction with the user and can dynamically create/manipulate page content. (Common uses are button graphic toggles, showing/hiding of elements, simple effects)

Almost all modern browsers support and have JavaScript enabled by default. There are many pre-written functions/applications available that can be imported with just one line of code. (These are then called to/used by the web program of course.)

JavaScript, unlike HTML at least, requires some basic and general programming knowledge of variables, functions, loops, etc. It is still simpler than many languages given that it is untyped (There is no need to worry about declaring variable types (int,boolean,char,etc.) as in other languages) and is somewhat flexible. Many times, its object-oriented nature (using prototype) isn't even implemented, rather it is used for simple specific functions only. Here are some of the most basic code examples:

The inclusion of a pre-written script:

<script src="js/myScriptFile.js"></script>

Calling to a function in an included script can be as simple as:

<script>myScriptFunction();</script>


If you find these articles to be helpful, I could always use another cup of coffee! Social media likes/+1s are also much appreciated. Thanks for reading!

Add Comment to Post: