Showing posts with label JavaScript. Show all posts
Showing posts with label JavaScript. Show all posts

Wednesday, 9 November 2016

Variables in Java Script

Like other programming languages ,Java Script also supports the variables. Variable is simply a place holder for a value.It can also be called as the container where we can place our values.Thus in order to store any value ,we need to register a space in the memory  that is to declare a variable and then initializing it with some value. It is necessary to declare a variable before using it.
Variables are declared in Java Script with keyword var is as follows:

<html>
<head><title>Java Script Variables</title>

<script type="text/javascript">
var a;
var b;
</script>

</head>
</html>
The process of assigning values to a variables is called as initialization process.Variables can be initialized at any point of time in program before using it.It can also be initialized  at the time of creation of variables.
Now we assign 10 to variable a and value 20 to variable b as follows:

<script type="text/javascript">
var a=10;
var b=20;
</script>

In Java Script it is not required to specify the data type for  a variable .A variable declared with Keyword 'var ' accepts all the values whether it is a character or decimal point or integer value.
Thats  why Java Script is also called as Untyped language.

In Java Script variables are of two types:
Local Variables and Global Variables

The variables which are declared with in the function block is called local variables and the scope of these variables lies only with in the function block.

While the variables declared outside the bock of function are called Global variables.These variables can be accessed anywhere with in the program.

Keywords in Java Script

Keywords are the reserved words that cannot be used as variable names in our code that means keywords are the special words that are reserved and were designed at the time of development of language.
Some of the keywords in Java Script are as follows:
abstract
boolean
 byte
char
class
const
debugger
double
enum
export
extends
final
float
goto
implements
import
int
interface
long
native
package
private
protected
 public
short
static
super
synchronized
throws
transient
volatile



Tuesday, 8 November 2016

Java Script Statements and Comments

Like other programming languages ,in Java Script a code consists of number of statements and a statement may be defined as the instruction or a command given to a system to do something ,this is how the programming language works .We give the system a set of instructions or statements which in turn performs the required task.
Comments may be defined as the use of small understandable notes in the code.It is a good practice to keep lot of comments in your programs as it improves the readability of the code and also it becomes easy for other programmers to understand the code easily. It is also possible to imitate some of the statements by the use of comments.

In Java Script there are two kinds of comments:
Single line Comments and
Multi line Comments
Single line Comments are used in single line and  acts as small notes in code while on the other hand multi line comments can imitate the effect of a complete block of code in a program that is the instructions written under the //......// will not be executed at all.

A single line Comment begins with:

<!-- ...............CODE ..............-->

while multi line Comment begins with
//  ...............CODE ............... //

The following program shows the use of single line comment and multi line comment in a program

<html>
<head>
<title>JavaScript</title>
<script type ="text/javascript">
<!--Prints message -->
document.write(''welcome to JavaScript");

</head>
</html>

Monday, 7 November 2016

Java Script




What is Java Script ?

Java script is the most popular Client Side Scripting language at the moment that was developed by Netscape in 1995. Here  by Client Side Scripting language what we mean that all the code gets executed on the  Client's computer or user's computer.



Image result for client server architecture



This is how we use Internet everyday ,we being the client request pages from the server which in turn gives back the response desired by the client or user.

Basically there are two different types of scripting languages viz:
          Client Side Scripting language which gets executed on  client's system like Java script
          Server Side Scripting language which gets executed on Server System like PHP , ASP etc

Java Script is totally different from server side technologies because server side scripting is the way we actually connect to database and have shopping carts ,web based mail programs and so on.These two  have completely different purposes but they are often used together

The main use of Java Script is to change the appearance of web pages that is to design highly interactive web pages that cannot be achieved by Simple HTML language.
If we are using Java Script then we can have animations ,sliding images  and other interactive features.
Java Script can also be used for form Validation which is very important.
Another application of Java Script is that we can create simple applications like calculators and even Games as well.

How to include Java Script in our code?

Basically Java Script code is included between Script tag  which is then included in head section of HTML as:
<html>
<head>
<title>Tutorial on JavaScript</title>
<script type ="text/javascript">
    document.write("Welcome to Java Script");
<script>
</head>
<body>
</body>
</html>


Even we have not included any thing in Body section but when we execute this code it will show output as :
Welcome to Java Script






Sunday, 6 November 2016

Introduction to Softwares

what is Software?

As per the industrial standard, a digitalised automated process is called as software.
When we are converting a manual process in the form of automated system, it is called as software.
Here digitalised means without human intervention or interaction process will be completed.
A software can also be defined as the set of programs or instructions that are designed for a specific task. Thus several programs combining together like a single unit,it is called a software component.
Types of Softwares:
Softwares can be broadly  classified into two types:
System software
Application software

System Softwares:

A software which is designed for general purpose and does not have any limitations is called system software.
System softwares are further classified into three types:
Operating-Systems like linux,Windows,Unix,DOS
Translators like compilers and interpreters
Packages like linkers,loaders,editors

Application softwares:

 A software which is designed for specific task only and having the limitations is called as application software.
All client specific projects are application softwares only because for what purpose we are developing the project for some purpose.
Application Softwares can be:
Application Packagers such as MS Office,Oracle
Special Purpose softwares like Tally
Microsoft Office is a Microsoft product which maintains the information in the form of documents.
Oracle is a database which maintains the important information in the form of tables.
Tally is a application software which maintains account related information.