Regent iTech - Software Training Institute

Corporate, Online and Classroom Trainng

Advanced Technology Hands On Training

Software Development - Mobile and Web

www.regent-itech.com   Call:9513325606

JavaScript Tutorials - Programming for web

Introduction

Interpreted programming or scripting language from Netscape.

Easier to code than the compiled languages like C and C++.

Lightweight and most commonly used script in web pages.

Allow client-side user to interact and create dynamic pages.

Cross-platform and object-oriented scripting language.

Most popular programming language in the world.

High level, dynamic and untyped programming language.

Standardized in the ECMAScript language specification.

Used for shorter programs

Takes longer time to process than compiled languages.

Where JavaScript is used ?

When a user requests an HTML page with JavaScript in it, the script is sent to the browser.

JavaScript used for creating dynamic web pages.

The JavaScript language is a free, client-side scripting language

Scripting adds interactivity to Hypertext Markup Language (HTML) pages.

Client-side means that the JavaScript language runs in the browser and is not used on the server side.

Client-side scripting allows user interactivity with a web page after the web page is served by the server and loaded by the browser.

Used in Web Forms Validations.

Used in Web and Mobile Development

Used to create Windows desktop applications

Used to create cross-platform applications via frameworks.

Used for Inserting and swapping Contents in Web Pages

Used across various platforms and browsers

Frameworks:

Library of functions and methods which helps developer to develop applications faster.

Include classes and functions that can be used to process input, manage hardware devices, and interact with system.

Framework is the foundation to streamlines the development process.

A framework is an pre-built template structure that handles most of the common features.

Allow designers and developers to focus on building the application quickly, rather than re-inventing the wheel.

Simplifies front-end application development.

Benefits include open source, good support, efficient, security and integration.

Limitations include - performance, one framework cannot satisfy the complete application, learning curve is more compared to CMS and very Expensive.

Get Started - JavaScript Coding.

Ti write javascript cod euse Webstorm or sublimeText or any other javascript IDE

Hello world program

/*Example statement here */

console.log("hello world");

//Using function parameters

var num = 10;

function increase(_num) {

num++;

}

num = increase(num);

console.log("num is: "+ num);

// Using the return statement in a function

function add(_num1, _num2)

{

return _num1+_num2;

}

var num = add(10, 10);

console.log("num is: "+ num);

Using Control Structure

// Using if, else if and else statement

var a=20;  

if(a==10){  

console.log("a is equal to 10");  

}  

else if(a==15){  

console.log("a is equal to 15");  

}  

else if(a==20){  

console.log("a is equal to 20");  

}  

else{  

console.log("a is not equal to 10, 15 or 20"); 

 

}  

//Structuring a for loop

 

var colors = new Array("orange", "blue", "red", "brown");

 

for(var i=0; i 

}

//Structuring a while loop

 

var i = 0;

 

while(i<10) {

 

console.log(i);

 

i++;

 

}

 

//Count lower case and upper case letter in text

function countcase(word){

 

var upper=0;

 

var lower=0;

 

console.log("wordlength:" + word.length);

 

for(var i=0;i 

if(isUpperCase(word[i])) {

 

upper=upper+1;

 

}

 

else{

 

lower=lower+1;

 

}

 

}

 

console.log("UpperCount:" +upper);

 

console.log("LowerCount:" +lower);

 

}

 

// Recursive Function

function fact(n) {

 

if (n <=1) return 1;

 

else return n* fact(n-1);

 

}

 

console.log(fact(5));

 

// countdown Function

function countdown(n) {

 

if (n <= 0) return;

 

else {

 

console.log(n);

 

countdown(--n);

 

}

 

}

 

countdown(6);

 

Office Address

Jayanagar 9th Block, Jayanagar, Bangalore. Karnataka, India - 560041. Landmark :opposite to Ragigudda / Central Mall , Behind Big Bazaar, Near Jain University & Opposite to LensKart.com and Himalaya Drugs , Call : 9886272445 / 9513325606