Looking for the JavaScript Training? Join Infibee Technologies is one of the best JavaScript Course offering expert mentors with 10+ years o

seen from Malaysia

seen from United States
seen from Germany
seen from United Kingdom
seen from China
seen from Malaysia
seen from United States

seen from United States
seen from United States
seen from United States

seen from United States
seen from Philippines
seen from United States
seen from United States

seen from United States

seen from United States
seen from Russia

seen from United States

seen from United States
seen from United Kingdom
Looking for the JavaScript Training? Join Infibee Technologies is one of the best JavaScript Course offering expert mentors with 10+ years o
JavaScript is one of the essential languages to learn if you want to excel in UI development. So, are you too interested in becoming its master? If yes then join our 3 months certificate advanced...
In this JavaScript course you are going to learn a lot about the advanced concepts of JavaScript. Before you join this course you must have a sound knowledge of HTML and CSS. This course is going to help you in shaping your career as UI developer! Check out our JavaScript course to get set go.
JavaScript Object Paradigm and prototypes explained
While we’re continuing to collect the most interesting and useful JS open source repositories, some things about JS itself left a bit complicated. That is why we’re happy to share with you some theoretical information on JavaScript. JavaScript Object Paradigm and prototypes...
Accelerated JavaScript Training - Udemy
Accelerated JavaScript Training – Udemy
Accelerated JavaScript Training – Udemy
Take a deep dive into JavaScript, a Must-Know Language in Web Development, with a Hands-on, Example-driven approach What you’ll learn
Use JavaScript to write modern, reactive Websites
Understand how JavaScript works and how to use its many advantages
Dive into JavaScript Libraries like jQuery or Frameworks like Angular 2 or React
Requirements
No…
View On WordPress
jQuery vs. JavaScript: Which One is Better
In beginning many web developers were confused about the term jQuery and JavaScript. And they are aware to know what is actually difference between jQuery and JavaScript. But they may surprise to know that both are same. Generally jQuery is a set of JavaScript API, which is designed to simplify HTML document traversing, animation, event handling and Ajax interactions.
But according to our choice to be a professional developer you must have a solid command over Javascript. If you are not aware about using JavaScript for website development, check out Javascript MasterCourse. Once you aware about JavaScript Language, you might analyze that jQuery Master Course fulfill most of your requirements and it's requires less coding than conventional JavaScript may require.
Introduction of JavaScript
JavaScript is scripting language which is developed to use within web browser. It is widely used for interface interactions. Slides show and another interactive components can easily done using this language.
JavaScript also widely used in creating game development, web applications, server side programming etc. New standards in JavaScript forces all web browsers to implement JavaScript formally, which reduces developers time and frustration trying to debug code for a specific web browsing client.
jQuery Introduction:
In early days when jQuery was not developed, web developer created their own frameworks in JavScript. These frameworks allowed developers to work around some specific bugs without wasting of time. Later a group of developers created JavaScript libraries, which was open source and free of cost and generally called JavaScript libraries.
So jQuery is a library of JavaScript developed by John Resig. It is easy to use and extremely powerful in comparison to other JavaScript libraries.
Which one is better?
Developer spend lot of time debating whether jQuery or JavaScript is best???? But the truth is that there is no correct answer of this question.... Either can be selected for development point of view, because whatever effects we perform using JavaScript, that effects can achieve using jQuery.
Some web development projects require traditional JavaScript, however jQuery is sufficient for most web development projects. Although jQuery may be preferably a choice for experienced developer, but as a fresher web developer should still take the time to learn both JavaScript and jQuery.
One biggest difference between jQuery and JavaScript is that jQuery has been optimized to support variety of browsers automatically. But Unfortunately JavaScript still has some issues with cross-browser compatibility due to poor JavaScript implementation.
Example:
jQuery
$ (‘body’) .css (‘background’, ‘#ccc’);
JavaScript
Function changeBachground(color) {
document.body.style.background = color;
//or
document.bgColor = color;
}
window.onload= “changeBackground (‘red’)”;
A single line of code accomplishes same result in jQuery, what it take 4 lines of JavaScript code.
Source: http://admec-multimedia-institute.blogspot.in/2016/08/jquery-vs-javascript-which-one-is-better.html
Basics Concepts of JavaScript
Java script is a client side scripting language and it is standardize by ECMA. Its code is written between opening <script> and closing </script> tags. By using JavaScript we can create dynamic web page. JavaScript is embedded within HTML.
<script> tag has "type" attribute you must need to add in scripts tag like.
<script type="text/javascript">
There are three ways to write JavaScript code in your web page.
embedded
external
inline
In external way: there is src attribute like <script type="text/javascript" src="script.js(filepath)"> while in embedded we write JavaScript inside the html page enclosed in <script></script> tags.
Note: never use inline because you write this in html elements so very difficult to manage.
What are Client Side Languages?
Client side scripting languages are executed on any client machine instead of server so it doesn't take time to execute.
What are Server Side Languages?
Server-side scripting is used in web development which involves scripts on a web server which produces a response customized for each client's request to the website.
Variable
variable stores the value.
variable have some to define.
1. variable name can be letter, number, any symbols.
var = x; var = 'bhumi'
2. variable name can't start with numbers it must start with letter.
3. variable name is case sensitive. Var and var both are different name
in JavaScript.
var = X; var = x; (both are different)
4. reserved keywords can't be given as variable name.
like function, switch, return etc.
5. logical operator[=, +, -, /] cannot use in variable name.
var = bh+bh;
6. blank space is not allowed within variable name.
var = 1 23;
Datatypes
The latest ECMAScript standard defines seven data types:
There are six primitive types of datatype.
1. Boolean
it has two values true and false.
2. null
it has one value null.
var a = null;
alert(a);//null
alert(a+'bhumi');//nullbhumi (concatenation)
3. undefined
variable has not assigned any value its undefined.
var a;
alert(a);//undefined
alert(a+'bhumi');//undefinedbhumi (concatenation)
4. number
variable has assigned by any number.
var a = 2;
5. String
variable has assigned by any latter.
var a = 'bhumi';
6. Symbol
(new in ECMAScript 6). A data type whose instances are unique and immutable.
Popups in JavaScript
There are three types of pop ups.
1. alert()
it is used for pop up alert message has one button is 'ok'.
alert('welcome to my website');//message
2. confirm()
it is used for conformation it has two button 'ok' and 'cancel'
confirm('Are you 18+');//ok and concel (Boolean = 0/1 or false/true)
3. prompt()
it is used to get vales from user.
prompt( 'Enter your age plz');
Function in JavaScript
A JavaScript function is a block of code designed to perform a particular task. A JavaScript function is executed when it call.
Syntax:
function function name(para1, para2)
{
return();
}
Example:
<button onclick="main()">Click me</button>
function main(){
alert('hey');
}
Benefits of Function
You can reuse code: Define the code once, and use it many times.
You can use the same code many times with different arguments, to produce different results.
function main(greet){
alert(greet);
}
main('namaste');
main('hi');
main('hello');
nested function:
function contains other function call nested function. Such functions are very useful for abstraction and encapsulation.
var name = 'Bhumi';
function main(){
//local;
nested();
}
main();
function nested(){
alert(name);
}
nested();
Scope in JavaScript
Two types of scope in function.
1. local variable
local variable can be use within the function. you cant use it out side the function.
2. global variable:
global variable can use anywhere in the code.
Conditionals in JavaScript
if...else:
-> Use if to specify a block of code to be executed, if a specified condition is true
-> Use else to specify a block of code to be executed, if the same condition is false
-> Use else if to specify a new condition to test, if the first condition is false
switch :
it has many alternative code to execute.
switch(condition){
case ..
break;
}
ternary:
it has two values true and false
var getName = 45;
var result = (getName == 45)?'yes it is':'no it is not';
alert(result);
Loops in JavaScript
Loops are set of code which is used to repeat the condition of loop block. Loops returns the true or false values depend on the condition.
You can counter the loops by increments and decrements.
For Loop:
syntax:
for (statement 1; statement 2; statement 3) {
code block to be executed
}
for (var i = 0; i < 10; i++) {
console.log(i);//0,1,2,3,4,5,6,7,8,9
};
For in loop
When variable does not stored in array or variable have key pvalue pair then you can use for in loop.
Syntax:
for (var in object) {
code block to be executed
}
var myArr = {
name : 'Bhumi',
sname : 'Golakia',
age : 22
}
alert( myArr['name'] ); //Bhumi
for( var i in myArr ){
console.log("At key "+i+" got "+myArr[i]+" value.");
}
while loop:
This loop control the flow of code depend on condition. this loop checks the condition first and then it will do increments or decrements
syntax :
while (condition) {
code block to be executed
}
while ( i < 10 ) {
console.log(i); //0,1,2,3,4,5,6,7,8,9
i++;
};
Do while loops:
This loop first do the increment or decrements and the it checks the condition. Control flow statement that executes a block of code at least once.
syntax:
do {
code block to be executed
}
while (condition);
do {
console.log("before: "+i);//0,1,2,3,4,5,6,7,8,9
i++;
}
while ( i < 10 );
Source: http://admec-multimedia-institute.blogspot.in/2016/06/basics-concepts-of-javascript.html
Control Statements in JavaScript
A conditional statement is a set of instructions that executes depending upon the condition is true or false.
As per MDN, JavaScript supports two conditional statements if…else and switch case.
JavaScript is a computer language mainly used for making Interactive websites under Web development.
if statement:
Statements inside if will be executed if the expression is true. If the expression is false then no statements will be executed. We will be using comparison operators to evaluate the expression.
Syntax:
if (expression)
{
statements will be executed only if the expression is true
}
Example:
<html>
<body>
<script type="text/javascript">
var age = prompt('Enter your age plz');
if( age >=18 ){
alert("Qualifies for driving");
}
</script>
</body>
</html>
Result:
Enter your age plz: 25
Qualifies for driving.
If we enter age greater than 18 then it will execute the statement otherwise will come out.
if ….else statement
It is the next form of control statements which allows to execute statements depending upon the expression is true or false.
Syntax:
if (expression)
{
statements will be executed only if the expression is true
}
else {
statements will be executed only if the expression is false
}
Example:
<html>
<body>
<script type="text/javascript">
var age = prompt('Enter ur age plz');
if( age >=18 ){
alert("Qualifies for driving");
}
else{
alert(“Doesn’t qualify for driving”);
}
</script>
</body>
</html>
Result:
Enter your age plz: 25
Qualifies for driving
Enter your age plz: 15
Doesn’t qualify for driving
If age is greater than or equal to 18 then it will execute the if statement otherwise will execute the else statement.
if else if statement:
This is more advanced form of if..else that will execute statements on the basis of given conditions. It is useful in the case of multiple conditions. In this case only the first logical condition which is true will be executed.This can also be known as nested if statements.
Syntax:
if (expression1){
statements will be executed only if the expression2 is true
}
else if (expression2){
statements will be executed only if the expression2 is true
}
else if (expression3){
statements will be executed only if the expression3 is true
}
else {
statements will be executed only if the expression is false
}
Example:
<html>
<body>
<script type="text/javascript">
var book = prompt('Enter bookname');
if( book = ‘Kiterunner’ ){
alert("It comes under fiction category");
}
else if( book = ‘Wasted in Engineering’ ){
alert("It comes under non fiction category");
}
else if( book = ‘A history of India’ ){
alert("It comes under history category");
}
else{
alert(‘Unknown category’);
}
</script>
</body>
</html>
Result:
It will display the result on the basis of the choices given. If we will enter Kiterunner in the prompt box, then ‘It comes under fiction category’ will be the output. If we will enter any bookname which is not mentioned, example ‘Madhushala’, then result will be ‘unknown category’. For comparison use == (equal operator). For comparison don’t use =. ‘=’ is used for assigning values not for comparing them.
SWITCH CASE
The main objective of switch case is to execute different statements given on the basis of expression given. Each case statement will be checked against the expression given until a match is found. If nothing founds default statement will be executed. Break is very important after each statement. If we will not give it then every statement will be executed.
Syntax:
switch (expression)
{
case condition 1: statement(s)
break;
case condition 2: statement(s)
break;
case condition n: statement(s)
break;
default: statement(s)
}
Example:
<!DOCTYPE html>
<html>
<head>
<title>Switch Case</title>
</head>
<body>
<script type="text/javascript">
var time = new Date();
var myday = time.getDay();
//alert(myday);
switch(myday){
case 0:
alert('it is sunday');
break;
case 1:
alert('it is monday')
break;
case 2:
alert('it is tuesday')
break;
case 3:
alert('it is wednesday')
break;
case 4:
alert('it is thursday')
break;
case 5:
alert('it is friday')
break;
case 6:
alert('it is saturday')
break;
default:break;
}
</script>
</body>
</html>
In the above example, new Date() function will display the current date and date with time zone.
In the above example, new Date() function will display the current date and date with time zone. The getDay() function in JavaScript returns the weekday as a number between 0 and 6. (Sunday=0, Monday=1, Tuesday=2, Wednesday =3, Thursday=4, Friday=5, Saturday=6). Result will be current day and it will execute the case depending upon on which day it has been executed. For example. If we are executing it today, i.e. 21st April 2016. It will find the match with Case 4 and execute it. Result will be “it is Thursday”.
JavaScript Video Tutorial Pt 1 ☞ http://codek.tv/v/HktFfZc #javascript #programming #tutorial #learnjavascript