Intro to JavaScript
JavaScript: A scripting language for web sites that was developed by Netscape. JavaScript is run on the client side as opposed to the server side. (In server side programming such as ASP and PHP, the broswer has to go back to the server and the code is processed there. In client side programming, all the processing is done by the browser itself.)
Javascript IS NOT Java. Despite the name similarity, JavaScript and Java have next to nothing in common. Java is a wonderful beast, deveoped by Sun Microsystems and is a spin off of C and C++ programming languages. With Java, programmers can create large applications and even control electronic devices and appliances. For client side programming Java creates something called applets which are mini programs that are downloaded from the internet and then run inside the web browser.
So why does JavaScript sound so much like Java? Basically, the computer industry was just trying to confuse the heck out of us. Netscape basically wanted to use the name JavaScript because Java was so popular–it was really a marketing ploy. But it gives all of the geeks out there something to talk about.
Where do we put JavaScript in the code? Scripts can be place in two places on an HTML page. Inside of the <head> </head> tags or between the <body></body>. This is the code to start inserting JavaScript:
<html>
<head>
<title>JavaScript Example</title>
<script language=”Javascript” type=”text/javascript”>
document.write(”I am learning javascript and I love it!”);
</script>
</head>
<body>
</body>
</html>
You can have as many scripts as you want on a page…although it is good practice to put them all together into one when possible.
Filed under: JavaScript



Leave a Reply