on air

Intro To JavaScript | Beginners Guide.

back home » Scripting Tutorials » Javascript » Intro To JavaScript | Beginners Guide.


What You'll Learn.

In this tutorial, you'll learn the basics of javascript, and how it work. However, you'll need to know the basics of the following languages.

The basic knowledge of HTML.

The basic knowledge of PHP.

What Is JavaScript?

JavaScript is a client-side scripting language implemented as part of a Web browser providing the enhancement of user interfaces, and dynamic websites. It's an object Oriented Programming language [OOP], that works with variables, strings, arrays, numbers, and objects, very similar to PHP and ActionScript 3.0.

JavaScript performs operations in real time like Adobe Flash, processed with ActionScript, independant of browser resfresness.

JavaScript copies many names, and naming customs also from Java. However, the two languages are irrelevant. [Warning; JAVASCRIPT and JAVA are two different scripting languages, get no confused].

How To Use JavaScript Inside Your Web Document.

There are three different methods or ways to implement javascript inside your web document.

Below are the examples on how to use them.

Including JavaScript From External .js File [Recommended].

Including JavaScript from an external .js file is the best method to use. Because this makes it easier maintaining your entire HTML Site, separately from your JavaScripts.

And you can modify a single .js file, to take effect on all the pages containing the included src link.

Use the src attribute to link to the .js file at its location, you must know its path first.

See Illustration Below.

<html>
<head>
<script type="text/javascript" src="../Script/myFirstScript.js"></script>
</head>
<body>content</body>
</html> 

Note Carefully: Your External .js file should contain only the raw JavaScript, without the script tags <script></script>

Including JavaScript Inside The <head> Tag.

Placing a Javascript inside the HTML <head> tag is a perfect method, when adding a script that will need to appear on a single page. See Illustration Below.

<html>
<head>
<script type="text/javascript">
function displayDate()
{
	document.getElementById("demo").innerHTML=Date();
}
</script>
</head>
<body>
<h1>Learning Javascript</h1>
<p id="demo"></p>
<button type="button" onclick="displayDate()">
Click To Display Date
</button>
</body>
</html> 

Direct JavaScripts. [Not Recommended]

Placing javascript directly inside the HTML <body> tag is an alternative you may use, writing a short message into your document. See Illustration Below.

<html>
<body>
<h1>Javascript</h1>
<p>The next line is</p>
<script type="text/javascript">
<!--
	document.write("Javascript inside a body tag");
//-->
</script>
<p>You can add more HTML content.</p>
</body>
</html> 
FasLane Tip#1.

Standardized, JavaScript belongs inside the <head> of a web page. This method allows functions to load before anything that calls the script will follow.

Scripts that are placed at the very end of a web page, may result in that. Part of the web page, including buttons with JavaScript function calls, be visible to users, while the rest of the page will still be loading.

And when a user hits a button or a link, this will result in getting JavaScript Error Message Alerts.

Because the javascript may not be fully loaded, and so browser can't find the script, executing the user's request.

JavaScript Libraries.

  • jQuery is a javascript library you can use to create your documents the easiest way, and it's for free. It's a simple and easy to use Javascript Library, that lays a bridge between your HTML document and external Javascripts created by some Javascript lovers around the globe.
  • YUI is a free, industrial-strength JavaScript and CSS framework open source library, proven to be fast, scalable, and robust for building richly interactive web applications.

Intro To JQuery.

Clicks4UrMind

Man will give you worldly powers, and make you feel on top of all, note this is temporally and could be redrawn at anytime sending you back to the ground floor of life. However, the Lord Almighty, the one and the only rightful ruler of the Universe, blesses everlastingly.

Brain

Knowledge is Power, but Power is not Knowledge. Wisdom is the truthful Power that identifies the Knowledge within the man. And only, I repeat 3x. Only the almighty God has the power to bless the man with his Wisdom forever.

To achieve the Lord's blessings, cease not praying daily, asking for his Wisdom, and you'll be blessed abundantly...

SPYERA PHONE

Spyera Phone

Spyera Phone version is software that you install on a smart phone to monitor everything happening on the phone. After installation, SPYERA secretly records events (sms, call history, phone book, location, emails, What's App messages, IM, Facebook Chat, Skype, See photos taken and many more...) that happen on the phone and delivers these information to a web account, where you can view these reports 24/7 from any Internet enabled computer or mobile phone. SPYERA also allows you to listen to the surroundings of the target mobile , listen to the phone conversation and to know the location of the device.

 

Please, Kindly Donate What You Can, Enabling Us Pay Hosting And Domain Costing, And Do More.

Please Donate