Code implemention of javascript:

Code Implementation of javascript:

javascript: Definition and code implementation:

Definition:

Javascript is a programming language that started out as a way to add logic and interaction to a network stacks browser. 

In the years since its introduction, it has not only developed numerous other competing languages ​​and technologies to become the standard of browser-based programming but also has grown beyond client space to become a dominant language on the server.

This part of the tutorial is about basic JavaScript, the language itself. But we need ed.a working environment to run our script and, since this book is online, the browser is a good choice. We will minimize the amount of browser-specific commands (such as warnings) so that you do not spend time if you plan to focus on another environment (such as node.js). We will focus on JavaScript in the browser in the next part of this article. So first, let's look at how we add scripts to a web page. For server-side environments (such as Node.js), you run the script with a command such as "node my.js".


<html>
<Head>
<title> multiplication table </title>
<Script type = "text / javascript">
Var rows = trace ("how many rows on your multiplication desk?");
Var cols = set off ("how many columns are there to your multiplication desk?");
If (rows == "" class == "" class == deprecated)
Elegance = 10;
Crate table (rows, classes);
Function advent desk (rows, classes)
Var j = 1;
Var output = "<table border = '1' width = '500' cell spacing = 'zero' Norma padding ='five'>";
For (i = 1; i <= rows; i ++)
Output = output + "<tr>";
While (j <= cols)
Output = output + "<td>" + in * j + "</td>";
J = j + 1;
Output = output + "</tr>";
J = 1;
Output = output + "</table>";
Record.write (output);
</script>
</head>
<body>
</body>
</html>

"Script" tag

Javascript programs can be inserted into any part of the HTML document with the tag.
For example:
<! Documents HTML>
&lt;html&gt;
&lt;body&gt;
<p> Before the script ... </p>

//Hello world
Print on-screen:
This code will display output on screen by implementing this code.


<p> ... after the script. </ p>
The tag has some features that are rarely used today but can still be found in the old code.
Modern markup:
The tag has some features that are rarely used today but can still be found in the old code.
Type attribute: 
The old HTML standard, HTML4, requires some kind of script. Usually this was type = "text / javascript". It is no longer needed. Also, modern HTML standards have radically changed the meaning of this attribute. Now, it can be used for JavaScript modules. But this is a modern topic. We will talk about the module in another part of the tutorial. Language attribute: 
This attribute was to show the script's language. This attribute no longer makes sense because JavaScript is the default language. No need to use it.it will in working form as in implemented in code as applied.
External scripts
If we have a lot of JavaScript code, we can put it in a separate file.
Script files are associated with src attribute with HTML.

Here, /path/to/script.js is an absolute way to script from the root of the site. One can also provide relative paths from the current page. For example, src = "script-js" in the current folder would mean any file "script.js".
We can also provide a full URL. For example www.knowledgehu92.info
To attach multiple scripts, use multiple tags like this:
 Operators:
We know a lot of operators from school. They are things like increase +, multiply *, subtract - and so on.
In this article, we will focus on aspects of operators that are not mathematical in school.

Unary and Binary operators:

Before we move on, let's understand some common terms.
Operators - on which operators are deployed. For example, 5 * 2 has two tops: the left operand 5 and the right is 2. Sometimes, people call them "arguments" instead of "operands".
Let x = 1;
x = -x;
Warning (x); // -1, unary negative was applied
An operator is a binary if it has two operators.
 The same minus exists in binary form:
x = 1, y = 3;
Warning (y - x); // 2, subtracts binary minus values
In the above example, we have two different operators that share the same symbol: a negative operator, a unary operator that overrides the symbol, and a subtraction operator, a binary operator that is numbered. Subtract from the other.

String connection, binary +:
Now, let's look at the special features of JavaScript operators that are beyond the mathematics of the school.
Basically, plus operator + number pairs.
But, if binary + is applied to indoor, it merges (agrees) with:
Let s = "my" + "string";
Warning (s); // string
These are functions of unary and binary operators and these applied to uniquely used as in operators. The next article will move to a further tutorial. kind regards to you!
www.knowlegehu92.info click for more informaion.

Previous
Next Post »