Follow us on Twitter!
It is never to LATE to become what you never WERE.
Wednesday, April 16, 2014
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Members Online
Total Online: 70
Guests Online: 69
Members Online: 1

Registered Members: 82803
Newest Member: Tired_of_being_ignorant
Latest Articles

JavaScript for Fools: Episode I

Arrow Image An explanatory series for the utmost beginners.

Right now I am going to assume that you know the basics of how a website works and HTML, but nothing whatsoever about JavaScript. You do not have to be a guru in the other subjects; it will just help understand the concepts better. Honestly, if you do not I cannot comprehend why you would be reading this tutorial. I suppose if reading random articles is your thing I should not judge, but wow, I am off on a tangent.

Anyway, what the hell is JavaScript and why is it talked about at all the fancy parties? First off, it is most definitely not Java, a programming language, which in my opinion is just a tad more difficult to master. JavaScript is a scripting language that is usually embedded in HTML and is used to accent web pages by added ways for the viewer to interact with the webmaster. By now most people can view JavaScript in their browser and all newer models will support it. If used properly it can enhance one\'s online experience. If used improperly there will be angry mob outside your window that will hurl burning feces at you on your way to the mailbox, so beware.

It will probably help if you can recognize what part of a website\'s coding is JavaScript. In many cases you will find it between these tags:

<script type="text/javascript"></script>

Some people, however, will need the same script on several separate pages and will not wish to write it on each one. If this is the case, they will most likely use what is called external JavaScript. Where the JavaScript would normally be you would see this:

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

The next basic thing to get down is comments. A lot of larger scripts with have side notes explaining their various parts. Comments come in two types:

//example one
/*example two*/

You will more often than not see people using example one, but become familiar with example two because it the only way to make a comment with multiple lines. Most people will just use several example ones to get the job done, but that is not the \"correct\" way to go about it. My oh me, what ever could come next?

\'Tis time for a somewhat random bit of knowledge. The computer-savvy know that JavaScript acts according to where it is placed in the website. When it is placed in the head section it will execute when it is triggered. If it happens to be placed in the body section it will kick in when the page loads. You can have as many JavaScripts as you fancy on your website; go ahead and put them in both sections if it thrills you so.

Now we move on to the wonderful world of variables. Upon reflection, that sounded a lot like my grade school Algebra teacher. As much as that thought severely disturbs me JavaScript variables are essentially the same as Algebraic variables. Before we get much further into this understand that variables must start with either the underscore character or a letter and they are quite case sensitive, but other than that you are fairly safe. The first step is to state the variable, like so:

var cheese="blue"

You do not absolutely need the var before your variable. I just think that it helps with organization as your scripts get longer. Either way that you choose, it will not be of much use without displaying it somewhere. One simple way of doing it is the following:

<script type="text/javascript">
var cheese="blue"

The above JavaScript would display the word \"blue\" on your website. Not terribly fantastic, but it a step towards bigger and better things. The \"docu<i></i>ment write\" bit is just a way to display text. You can try it without a variable by just using quotes:

docu<i></i>ment.write(\"poetry and aeroplanes\")

Yes, it would seem less of a hassle to do that using HTML, but if you want to change it do a different type of cheese later on, let us say oregano, it would be a lot simpler to just change the variable instead of doing a search and replace marathon. Right now I wish I would have done that with my e-mail address, but alas, I did not. Curse you, overpriced America On-Line. Why was g-mail not invented sooner?

Ahem, well, what I presume may be Carpel Tunnel is setting in and my wrists are having seizures. Keep an eye out for my next installment, \"JavaScript for Fools: Episode II.\" I bid you fellows adieu.


wolfmankurdon July 09 2005 - 10:07:56
Nice articles, I didn't really get that argebra>javascript link but meh Pfft Javascript is one of the few things I understandSmile
Summericaon July 17 2005 - 00:51:40
I really hope so. Maybe learning from the beginning of topics will steer people away from being 'skiddies' later on.
Nubzzzon March 31 2007 - 04:20:36
nice article
Post Comment


You must have completed the challenge Basic 1 and have 100 points or more, to be able to post.