Javascript Tutor – Lesson 2

Variables.

What’s a variable? Let’s suppose x=5.

x is a variable. The statement x=5 declares that the value of x is now 5. Can x be something else? Sure, x=6. Now x equals 6. (Hence the name “variable”… it’s value can vary.)

Can a variable be something other than a number? Sure. How about x=”Joe”. Now x equals the string “Joe”. (A string by the way is a string of characters… and strings are always enclosed in quotes.)

Can the name of a variable be something other than a letter like x? Sure, myname=”Joe”. Simple.

How can we incorporate this new found knowledge into our function? Easy…

<html>
<head>
<title></title>

<script type="text/javascript">

function HelloWorld()
{
   myname = "Joe";
   alert(myname);
}

</script>

</head>
<body>

<a href="javascript:HelloWorld()">Hello</a>

</body>
</html>

(Note again that strings are always enclosed in quotes, but variables are not.)

What we have called is the alert method. Think of a method as a command. Javascript has many methods.

We could make it say Hello + variable…

<html>
<head>
<title></title>

<script type="text/javascript">

function HelloWorld()
{
   myname = "Joe";
   alert("Hello " + myname);
}

</script>

</head>
<body>

<a href="javascript:HelloWorld()">Hello</a>

</body>
</html>
images

JavaScript – Lesson 1. Concepts

JavaScript programming language was developed by Netscape in collaboration with Sun Microsystems and anansirovan in 1995. JavaScript is used to create interactive html-documents. Main areas of use of JavaScript:

Making pages dynamic, ie pages, the content of which may change after loading.

Verification of user forms.

Decision “local” tasks using scripts.

JavaScript-code – the basis of most Ajax-applications.

JavaScript allows you to create applications that run on the client side, ie These applications run on the user’s computer browser

Programs (scripts) are processed in this language interpreter built-in browser. Unfortunately, not all scripts are executed correctly in all browsers, so test your javascript-programs in different browsers. JavaScript is case sensitive, ie uppercase and lowercase letters of the alphabet are considered different characters. Before you start writing the script, you should be familiar with the basic concepts, such as literals, variables, and expressions.

images

 

JavaScript

Hi guys!!!!Consider one of the most popular programming languages ​​JavaScript

Javascript – NOT java, but quite another language. He seems to say, but no more. We have your standard javascript: ECMAScript. Someone said that javascript is similar to Python, someone talks about similarities with languages ​​Ruby, Self. The truth is that the javascript itself. This is really a special language

Main areas of use JavaScript as follows:
the creation of dynamic, interactive Web pages, ie, pages whose content may change after loading the document;
Verification of user forms before forwarding them to the server;
decision “local” tasks using scripts and some other areas.

Google
image

cursor

cursor Ustanavlivaet cursor shape when it is within the cell. The cursor depends on the operating system and installed options.

Before you take the opportunity to alter the cursor, choose, and whether it will be used to the place. Many users of such changes can be misleading when, for example, instead of the traditional hand that appears when you hover over a link, there is something else. In most cases, it is better to leave everything as it is.