π₯A JavaScript function is defined with the function keyword,
followed by a name, followed by parentheses ()
The code to be executed, by the function, is placed inside curly brackets: {}
πfunction
name(parameter1, parameter2, parameter3) {
code to be executed
}
π₯ We can use function different ways
π<script>
function myFunction() {
document.getElementById("demo").innerHTML = "Hello World!";
}
myFunction();
π<script>
function myFunction(name) {
return "Hello " + name;
}
document.getElementById("demo").innerHTML = myFunction("John");
</script>
π₯OBJECT
π <script>
var person = {
firstName : "John",
lastName : "Doe",
age : 50,
eyeColor : "blue"
};
document.getElementById("demo").innerHTML =
person.firstName + " is " + person.age + " years old.";
</script>
output John is 50 years old
π<script>
var person = {
firstName: "John",
lastName : "Doe",
id : 5566,
fullName : function() {
return this.firstName + " " + this.lastName;
}
};
document.getElementById("demo").innerHTML = person.fullName();
</script>
output John Doe
Friday, May 26, 2017
Java Script Data Type
π₯JavaScript variables can hold many data types:
document.getElementById("demo").innerHTML =
typeof true + "<br>" +
typeof false;
</script>
var person = {firstName:"John", lastName:"Doe", age:50, eyeColor:"blue"};
var person = null;
document.getElementById("demo").innerHTML = typeof person;
</script>
out put object
var person;
document.getElementById("demo").innerHTML =
person + "<br>" + typeof person;
</script>
π₯JavaScript evaluates expressions from left to right. Different sequences can produce different results
π<script>
var x = "Volvo" + 16 + 4;
document.getElementById("demo").innerHTML = x;
</script>
output volvo164
π <script>
var x = 16 + 4 + "Volvo";
document.getElementById("demo").innerHTML = x;
</script>
output 20Volvo
π₯We can use single or double invert comma for string & use quotes inside a string
π<script>
var carName1 = "Volvo XC60";
var carName2 = 'Volvo XC60';
var answer1 = "It's alright";
var answer2 = "He is called 'Johnny'";
var answer3 = 'He is called "Johnny"';
document.getElementById("demo").innerHTML =
carName1 + "<br>" +
carName2 + "<br>" +
answer1 + "<br>" +
answer2 + "<br>" +
answer3;
</script>
output
Volvo XC60
Volvo XC60
It's alright
He is called 'Johnny'
He is called "Johnny"
- numbers
- strings
- objects
- boolean
document.getElementById("demo").innerHTML =
typeof true + "<br>" +
typeof false;
</script>
- null
var person = {firstName:"John", lastName:"Doe", age:50, eyeColor:"blue"};
var person = null;
document.getElementById("demo").innerHTML = typeof person;
</script>
out put object
- undefined
var person;
document.getElementById("demo").innerHTML =
person + "<br>" + typeof person;
</script>
π₯JavaScript evaluates expressions from left to right. Different sequences can produce different results
π<script>
var x = "Volvo" + 16 + 4;
document.getElementById("demo").innerHTML = x;
</script>
output volvo164
π <script>
var x = 16 + 4 + "Volvo";
document.getElementById("demo").innerHTML = x;
</script>
output 20Volvo
π₯We can use single or double invert comma for string & use quotes inside a string
π<script>
var carName1 = "Volvo XC60";
var carName2 = 'Volvo XC60';
var answer1 = "It's alright";
var answer2 = "He is called 'Johnny'";
var answer3 = 'He is called "Johnny"';
document.getElementById("demo").innerHTML =
carName1 + "<br>" +
carName2 + "<br>" +
answer1 + "<br>" +
answer2 + "<br>" +
answer3;
</script>
output
Volvo XC60
Volvo XC60
It's alright
He is called 'Johnny'
He is called "Johnny"
JavaScript Arithmetic
π₯The addition operator (+) adds numbers
π<script>
var x = 10;
var y = 2;
var z = x + y;
document.getElementById("demo").innerHTML = z;
</script>
output 12
π₯The subtraction operator (-) subtracts numbers
π<script>
var x = 5;
var y = 2;
var z = x - y;
document.getElementById("demo").innerHTML = z
</script>
output 3
π₯The multiplication operator (*) multiplies numbers
π<script>
var x = 5;
var y = 6;
var z = x * y;
document.getElementById("demo").innerHTML = z;
</script>
OR
output 30<script>
var x = 10;
x *= 5;
document.getElementById("demo").innerHTML = x;
</script>
output 50
π₯The modular operator (%) returns the division remainder.
π <script>
var x = 5;
var y = 2;
var z = x % y;
document.getElementById("demo").innerHTML = z;
</script>
output 1
OR
<script>
var x = 10;
x %= 5;
document.getElementById("demo").innerHTML = x;
</script>
output 0
π₯The increment operator (++) increments numbers
π<script>
var x = 5;
x++;
var z = x;
document.getElementById("demo").innerHTML = z;
</script>
output 6
π₯Operator precedence describes the order in which operations are performed in an arithmetic expression.
π<script>
document.getElementById("demo").innerHTML = 100 + 50 * 3;
</script>
output 250
π <script>
document.getElementById("demo").innerHTML = (100 + 50) * 3;
</script>
output 450
Java Script variable
π₯Creating a variable in JavaScript is called "declaring" a variable.
- You declare a JavaScript variable with the var keyword
- Start the statement with var and separate the variables by comma
- you can do arithmetic with JavaScript variables
π <script>
var x = 2 + 3 + "5"
document.getElementById("demo").innerHTML = x;
</script>
output: 55
π<script>
var x = 5 + 2 + 3;
document.getElementById("demo").innerHTML = x;
</script>
output: 10
π<script>
x = "5" + 2 + 3;
document.getElementById("demo").innerHTML = x;
</script>
output: 523
π <script>
var x = 5;
var y = 2;
var z = x * y;
document.getElementById("demo").innerHTML = z;
</script>
outtput 10
Tuesday, May 23, 2017
Javascript
π₯ JAVASCRIPT
JavaScript is a dynamic computer programming language. It is lightweight and most commonly used as a part of web pages, whose implementations allow client-side script to interact with the user and make dynamic pages. It is an interpreted programming language with object-oriented capabilities.
π₯why use JavaScript
JavaScript is one of the 3 languages all web developers must learn:
1. HTML to define the content of web pages
2. CSS to specify the layout of web pages
3. JavaScript to program the behavior of web pages
π₯Where to use Java Script
π’ In HTML, JavaScript code must be inserted between <script> and </script> tags.
<p id="demo"></p>
<script>
document.getElementById("demo").innerHTML = "My First JavaScript";
</script>
π’Scripts can be placed in the <body>, or in the <head> section of an HTML page, or in both.
<head> <script>
function myFunction() {
document.getElementById("demo").innerHTML = "Paragraph changed.";
}
</script> </head>
<body>
<p id="demo"></p>
<button type="button" onclick="myFunction()">Try it</button>
<script>
function myFunction() {
document.getElementById("demo").innerHTML = "Paragraph changed.";
}
</script>
</body>
π’ Scripts can also be placed in external files
external files has some advantages:
The variables lastName and lastname, are two different variables.
Eg:
<script>
var lastname, lastName;
lastName = "Doe";
lastname = "Peterson";
document.getElementById("demo").innerHTML = lastName;
</script>
out put: Doe
first_name, last_name, master_card, inter_city.
Upper Camel Case
FirstName, LastName, MasterCard, InterCity.
Lower Camel Case
use camel case that starts with a lowercase letter
firstName, lastName, masterCard, interCity.
JavaScript is a dynamic computer programming language. It is lightweight and most commonly used as a part of web pages, whose implementations allow client-side script to interact with the user and make dynamic pages. It is an interpreted programming language with object-oriented capabilities.
π₯why use JavaScript
JavaScript is one of the 3 languages all web developers must learn:
1. HTML to define the content of web pages
2. CSS to specify the layout of web pages
3. JavaScript to program the behavior of web pages
π₯Where to use Java Script
π’ In HTML, JavaScript code must be inserted between <script> and </script> tags.
<p id="demo"></p>
<script>
document.getElementById("demo").innerHTML = "My First JavaScript";
</script>
π’Scripts can be placed in the <body>, or in the <head> section of an HTML page, or in both.
<head> <script>
function myFunction() {
document.getElementById("demo").innerHTML = "Paragraph changed.";
}
</script> </head>
<body>
<p id="demo"></p>
<button type="button" onclick="myFunction()">Try it</button>
<script>
function myFunction() {
document.getElementById("demo").innerHTML = "Paragraph changed.";
}
</script>
</body>
π’ Scripts can also be placed in external files
external files has some advantages:
- It separates HTML and code
- It makes HTML and JavaScript easier to read and maintain
- Cached JavaScript files can speed up page loads
<script src="myScript1.js"></script>
<script src="myScript2.js"></script>
π₯JavaScript can "display" data in different ways
- Writing into an HTML element, using innerHTML.
- Writing into the HTML output using document.write().
- Writing into an alert box, using window.alert().
- Writing into the browser console, using console.log().
π₯JavaScript syntax is the set of rules, how
JavaScript programs are constructed.
π₯JavaScript statements are composed of:
Values, Operators, Expressions, Keywords,
and Comments.
π₯The JavaScript syntax defines two types of values: Fixed values and variable
values.
Fixed values are called literals. Variable values are called
variables.
π₯ Java Script Variables
variables
are used to store data values.
JavaScript uses the var keyword to declare variables.
An equal sign is used to assign values to variables.
Eg:
<script>
var x;
x = 6;
document.getElementById("demo").innerHTML = x;
</script>
π’ The values can be of various types, such as numbers and strings.
Eg: "John" + " " + "Doe", evaluates to "John Doe"
π₯Java Script Comments
Code after double slashes
// or between /* and */ is treated as a comment
π₯JavaScript is Case Sensitive
All JavaScript identifiers are case sensitive.The variables lastName and lastname, are two different variables.
Eg:
<script>
var lastname, lastName;
lastName = "Doe";
lastname = "Peterson";
document.getElementById("demo").innerHTML = lastName;
</script>
out put: Doe
π₯Java Script is Camel Case
Hyphens
first-name, last-name, master-card, inter-city.
π± Hyphens are not allowed in JavaScript. It is reserved for subtractions.
Underscorefirst_name, last_name, master_card, inter_city.
Upper Camel Case
FirstName, LastName, MasterCard, InterCity.
Lower Camel Case
use camel case that starts with a lowercase letter
firstName, lastName, masterCard, interCity.
Tuesday, May 16, 2017
busieness skill workshop
10.05.2017
This is our important workshop because Mr Sayanthan Anna was explained about basic business knowledge and our final project ideas.
An organization or economic system where goods and services are exchanged for one another or for money.
Every business requires some form of investment and enough customers to whom its output can be sold on a consistent basis in order to make a profit.
Read more: http://www.businessdictionary.com/definition/business.html
what is business???
The term business means continuous production and distribution of goods and services with the aim of earning profits under uncertain market conditions.
Then we had brain
storming
session about our
final
project ideas.
This session very useful to me will chose my final project topic.
After that we learned how to prepared our final project proposal.
A project proposal is a detailed description of a series of activities aimed at solving a certain problem . In order to be successful, the document should provide a logical project of a research idea. illustrate the significance of the idea.
This is our important workshop because Mr Sayanthan Anna was explained about basic business knowledge and our final project ideas.
An organization or economic system where goods and services are exchanged for one another or for money.
Every business requires some form of investment and enough customers to whom its output can be sold on a consistent basis in order to make a profit.
Read more: http://www.businessdictionary.com/definition/business.html
what is business???
The term business means continuous production and distribution of goods and services with the aim of earning profits under uncertain market conditions.
Then we had brain
storming
session about our
final
project ideas.
This session very useful to me will chose my final project topic.
After that we learned how to prepared our final project proposal.
A project proposal is a detailed description of a series of activities aimed at solving a certain problem . In order to be successful, the document should provide a logical project of a research idea. illustrate the significance of the idea.
Good session. i got useful ideas also.π
Common notes
JAVASCRIPT ENGINE
Inspect element
There's a powerful tool hiding in your browser Inspect Element. Right-click on any web page, click Inspect,
and you'll see the innards of that site: its source code, the images
and CSS that form its design, the fonts and icons it uses, and the
Javascript code that powers animations and more.
Git hub merge & fetch
git clone
git fetch
git merge
git pull
clone
and fetch
download remote code from a repository's remote URL to your local
computer, merge
is used to merge different people's work together with yours,
and pull
is a combination of fetch
and merge.
fetch
Use
git fetch
to retrieve new work done by other people. Fetching from a
repository grabs all the new remote-tracking branches and tags without
merging those changes into your own branches.If you already have a local repository with a remote URL set up for the desired project, you can grab all the new information by using
git fetch *remotename*
in the terminal.merge
Merging combines your local changes with changes made by others.
Typically, you'd merge a remote-tracking branch (i.e., a branch fetched from a remote repository) with your local branch:
personal coaching
π§ MBO (management By Objective )
Management by objectives (MBO) is a management model that aims to improve performance of an organization by clearly defining objectives that are agreed to by both management and employees. According to the theory, having a say in goal setting and action plans should ensure better participation and commitment among employees, as well as alignment of objectives across the organization.
π¦ CENTRALIZATION
It is said to be a process where the concentration of decision making is in a few hands. All the important decision and actions at the lower level, all subjects and actions at the lower level are subject to the approval of top management.
π DECENTRALIZATION
Decentralization is the process of redistributing or dispersing functions, powers, people or things away from a central location or authority.
Transfer of decision making power and assignment of accountability and responsibility for results. It is accompanied by delegation of commensurate authority to individuals or units at all levels of an organization even those far removed from headquarters or other centers of power.
Read more: http://www.businessdictionary.com/definition/decentralization.html
Transfer of decision making power and assignment of accountability and responsibility for results. It is accompanied by delegation of commensurate authority to individuals or units at all levels of an organization even those far removed from headquarters or other centers of power.
Read more: http://www.businessdictionary.com/definition/decentralization.html
π₯ centralization vs decentralization
π¦ Task orientated
Task-oriented (or task-focused) leadership is a behavioral approach in which the leader focuses on the tasks that need to be performed in order to meet certain goals, or to achieve a certain performance standard.
π¦ Employee orientated
Employee orientation is a trait of a manager who cares about the people who work for him. For long-term motivation, employees generally want to know their leader cares about them as people.
π€ Task orientated vs Employee
Management by objectives (MBO) is a management model that aims to improve performance of an organization by clearly defining objectives that are agreed to by both management and employees. According to the theory, having a say in goal setting and action plans should ensure better participation and commitment among employees, as well as alignment of objectives across the organization.
It is said to be a process where the concentration of decision making is in a few hands. All the important decision and actions at the lower level, all subjects and actions at the lower level are subject to the approval of top management.
π DECENTRALIZATION
Decentralization is the process of redistributing or dispersing functions, powers, people or things away from a central location or authority.
Transfer of decision making power and assignment of accountability and responsibility for results. It is accompanied by delegation of commensurate authority to individuals or units at all levels of an organization even those far removed from headquarters or other centers of power.
Read more: http://www.businessdictionary.com/definition/decentralization.html
Transfer of decision making power and assignment of accountability and responsibility for results. It is accompanied by delegation of commensurate authority to individuals or units at all levels of an organization even those far removed from headquarters or other centers of power.
Read more: http://www.businessdictionary.com/definition/decentralization.html
π¦ Task orientated
Task-oriented (or task-focused) leadership is a behavioral approach in which the leader focuses on the tasks that need to be performed in order to meet certain goals, or to achieve a certain performance standard.
π¦ Employee orientated
Employee orientation is a trait of a manager who cares about the people who work for him. For long-term motivation, employees generally want to know their leader cares about them as people.
π€ Task orientated vs Employee
Wednesday, May 3, 2017
BOOTSTRAP
π§BOOTSTRAP
πWhere to Get Bootstrap?
There are two ways to start using Bootstrap on our own web site.
we can:
Example
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
</head>
<body>
<div class="container-fluid">
<h1>My First Bootstrap Page</h1>
<p>This part is inside a .container-fluid class.</p>
<p>The .container-fluid class provides a full width container, spanning the entire width of the viewport.</p>
</div>
</body>
</html>
If you want more details about bootstrap classes use this URRL: https://www.w3schools.com/bootstrap/bootstrap_ref_all_classes.asp
- Bootstrap is a free front-end framework for faster and easier web development
- Bootstrap includes HTML and CSS based design templates for typography, forms, buttons, tables, navigation, modal, image carousels and many other, as well as optional JavaScript plugins
- Bootstrap also gives you the ability to easily create responsive designs
π’Why Use Bootstrap?
- Easy to use: Anybody with just basic knowledge of HTML and CSS can start using Bootstrap
- Responsive features: Bootstrap's responsive CSS adjusts to phones, tablets, and desktops
- Mobile-first approach: In Bootstrap 3, mobile-first styles are part of the core framework
- Browser compatibility: Bootstrap is compatible with all modern browsers (Chrome, Firefox, Internet Explorer, Safari, and Opera)
πWhere to Get Bootstrap?
There are two ways to start using Bootstrap on our own web site.
we can:
- Download Bootstrap from getbootstrap.com(If we want to download and host Bootstrap ourself, go to getbootstrap.com, and follow the instructions there.)
- Include Bootstrap from a CDN (If we don't want to download and host Bootstrap ourself, we can include it from a CDN (Content Delivery Network)
Example
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
</head>
<body>
<div class="container-fluid">
<h1>My First Bootstrap Page</h1>
<p>This part is inside a .container-fluid class.</p>
<p>The .container-fluid class provides a full width container, spanning the entire width of the viewport.</p>
</div>
</body>
</html>
If you want more details about bootstrap classes use this URRL: https://www.w3schools.com/bootstrap/bootstrap_ref_all_classes.asp
use for div tags
π <div> tag
The <div> tag defines a division or a section in an HTML document.
The <div> tag is used to group block-elements to format them with CSS.
Example
different div id & div class
The <div> tag defines a division or a section in an HTML document.
The <div> tag is used to group block-elements to format them with CSS.
Example
different div id & div class
1. <!DOCTYPE HTML>
<html>
<head>
<style>
#mycolor1 {color: red;}
.mycolor2 {color: red;}
</style>
</head>
<body>
<div id="mycolor1"> hello world </div>
<div class="mycolor2"> hello world </div>
</body>
</html>
2. <!DOCTYPE html>
<html>
<html>
<head>
<style>
div {
display: block;
}
</style>
</head>
<body>
A div element is displayed like this:
<div>This is some text in a div element.</div>
Change the default CSS settings to see the effect.
</body>
</html>
Personal coaching (leader ship)
π§ LEADER SHIP
The action of leading a group of people or an organizations.
π³ LEADER SHIP STYLES
The main difference between leaders and managers is that leaders have people follow them while managers have people who work for them. A successful business owner needs to be both a strong leader and manager to get their team on board to follow them towards their vision of success.
The action of leading a group of people or an organizations.
π³ LEADER SHIP STYLES
Some companies offer several
leadership styles within the organization, dependent upon the necessary
tasks to complete and departmental needs.
- Laissez-Fair. ...
- Autocratic. ...
- Participative. ...
- Transactional. ...
- Transformational.
The main difference between leaders and managers is that leaders have people follow them while managers have people who work for them. A successful business owner needs to be both a strong leader and manager to get their team on board to follow them towards their vision of success.
π¦ TRANSACTIONAL LEADER
style of leadership that is based on the setting of clear objectives and goals for the followers as well as use either punishment or rewards on oder to encourage complains with these goals.
π₯characteristics
- Extrinsic motivation. A transactional leader aims to elicit desired performance from the team by motivating them externally. ...
- Practicality. ...
- Resistant to change. ...
- Discourage independent thinking. ...
- Rewards performance. ...
- Constrained thinking. ...
- Passive.
- Directive.
π₯ TRANSFORMATIONAL LEADER
Transformational leadership is a style of leadership where a leader
works with subordinates to identify needed change, creating a vision to
guide the change through inspiration, and executing the change in
tandem with committed members of a group.
that is based on the setting of clear objectives and goals for the followers as well as the use of either punishments or rewards
Read more: http://www.businessdictionary.com/definition/transactional-leadership.html
Read more: http://www.businessdictionary.com/definition/transactional-leadership.html
that is based on the setting of clear objectives and goals for the followers as well as the use of either punishments or rewards
Read more: http://www.businessdictionary.com/definition/transactional-leadership.html
Read more: http://www.businessdictionary.com/definition/transactional-leadership.html
leadership that is
based on the setting of clear objectives and goals for the followers as
well as the use of either punishments or rewards in order to encourage
compliance with these goals.
Read more: http://www.businessdictionary.com/definition/transactional-leadership.html
Read more: http://www.businessdictionary.com/definition/transactional-leadership.html
leadership that is
based on the setting of clear objectives and goals for the followers as
well as the use of either punishments or rewards in order to encourage
compliance with these goals.
Read more: http://www.businessdictionary.com/definition/transactional-leadership.html
Read more: http://www.businessdictionary.com/definition/transactional-leadership.html
π¦characteristics
- A clear vision: Transformational leaders have a vision of what they want to achieve and the ability to clearly communicate this vision so that everyone in the organization understands what is needed to achieve this vision. ...
- Courage: ...
- Self-motivation: ...
- Inspiration: ...
- Know your people: ...
- Set a company standard: ...
- Follow through:
f leadership that is
based on the setting of clear objectives and goals for the followers as
well as the use of either punishments or rewards in order to encourage
compliance with these goals.
Read more: http://www.businessdictionary.com/definition/transactional-leadership.html
Read more: http://www.businessdictionary.com/definition/transactional-leadership.html
leadership that is
based on the setting of clear objectives and goals for the followers as
well as the use of either punishments or rewards in order to encourage
compliance with these goals.
Read more: http://www.businessdictionary.com/definition/transactional-leadership.html
Read more: http://www.businessdictionary.com/definition/transactional-leadership.html
f leadership that is
based on the setting of clear objectives and goals for the followers as
well as the use of either punishments or rewards in order to encourage
compliance with these goals.
Read more: http://www.businessdictionary.com/definition/transactional-leadership.html
Read more: http://www.businessdictionary.com/definition/transactional-leadership.html
Subscribe to:
Posts (Atom)