You are on page 1of 8

FORMATIVES You can place data into these containers and then

Web Design Visual Aspect key points include: A refer to the data simply by naming the container -
site map of pages. - False ?; Design Plan True
Helping people not to see the results of their A function is a group of reusable code which can be
actions, is one of the important functions in using called anywhere in your program. This eliminates
micro-interaction - False; helping people to see the need of writing the same code again and again.
Most of the type principles that apply to avoid using It helps programmers in writing modular code. -
text as graphics - True True
Most of the type principles that apply to : design for For instance, you might create a variable named
Fancy - False; legibility money and assign the value 2000.50 to it later. For
Most of the type principles that apply to : do not another variable, you can assign a value at the time
avoid using text as graphics - False; avoid of initialization - True
Web Design Visual Aspect includes : Accessibility - The value type of a variable can change during the
True execution of a program and JavaScript takes care
There are four elements will help you start of it automatically - True
improving your site’s usability and UX right away. -
True Are Java and JavaScript not the same? - True
Communicating status and providing feedback, is The script tag provides a mechanism to allow you
one of the important functions in using micro- to store JavaScript in an external file and then
interaction - True include it into your HTML files. - True
Manipulate images and text to re-create a best The break statements indicate the end of a
practice advertisement in creating a website - particular case. If they were omitted, the interpreter
False; PowerPoint would continue executing each statement in each
An animation is not a good example of micro- of the following cases - True
interaction - False; good JavaScript variable can hold a value of any data
type - True
Human-visible listings, typically hierarchical, of the You can do variable initialization at the time of
pages on a site, is one of the primary kinds of site variable creation or at a later point in time when you
map? - True need that variable. - True
In Type Design Principles, you cannot consider to The ...else if... statement is an advanced form of
choose fewer fonts and sizes - False; can if…else that allows JavaScript to make a correct
You can use the space around content (it can be decision out of several conditions. - False; if...else
any color, not just white) to draw attention to certain if…
pieces of content - True
Most of the type principles that apply to do not use SUPPLEMENTARY
available fonts - False; use Web designing has direct link to visual aspect of a
Most of the type principles that apply to design for web site.
legibility - True
In a system-initiated trigger, software detects
certain qualifications are being met and initiates a
request - False; action
In a user-initiated trigger, the user has to initiate an
action - True

Other uses of JavaScript for applications like


Photography - False; Acrobat/Photoshop
You are not restricted to be maintaining identical
code in multiple HTML files - True
Key Points VISUAL HIERARCHY IN WEB DESIGN
Design Plan should include the following: Here is some of the example showcasing visual
Details about information architecture. hierarchy to guide users through the content and
Planned structure of site. create a natural flow in the design
A site map of pages
HIERARCHY PRINCIPLES
Wireframe The human eye perceives information visually
refers to a visual guide to appearance of web rather than as blocks of data. Unlike computers,
pages. It helps to define we’re at the mercy of our eyes’ natural tendencies.
structure of web site, linking between web pages The reading material we likely encountered as
and layout of visual elements. young children featured many pictures and larger
Following things are included in a wireframe: print. Whether these were comics, coloring books,
• Boxes of primary graphical elements or story books, we could take in what was going on
• Placement of headlines and sub headings because we perceived the illustrations and
• Simple layout structure interpreted the sequence of events alongside the
• Calls to action easy to read text.
• Text blocks
BALANCE
A site map (or sitemap is a list of pages of a web • Symmetrical Balance
site There are three primary kinds of site map: Site • Asymmetrical Balance
maps used during the planning of a Web site by its • Radial Balance
designers. Human visible listings, typically
hierarchical, of the pages on a site Structured CONTRAST
listings intended for web crawlers such as search Painting just one of your nails a bolder color or
engines wearing flashy sneakers with a black tuxedo: some
of us are pulling off the principle of contrast without
WEB PAGE ANATOMY even realizing it. Aside from colors, contrast can be
Container can be in the form of page’s body tag, an reached with the use of round vs. sharp shapes,
all containing div tag. Without container there negative vs. positive space, smooth vs. rough
would be no place to put the contents of a web textures and essentially any elements that are
page. inherently opposite of each other.
Logo refers to the identity of a website and is used
across a company’s various forms of marketing EMPHASIS
such as business cards, letterhead, brouchers and This is emphasis: when an element naturally
so on. becomes dominant in a composition. There are
The site’s navigation system should be easy to find many ways to implement this in art and design. It’s
and use. Oftenly the anvigation is placed rigth at often achieved through the previously mentioned
the top of the page. principle, contrast, but not exclusively.
The content on a web site should be relevant to the
purpose of the web site. MOVEMENT
Footer is located at the bottom of the page. It The point is, movement is attention grabbing, even
usually contains copyright, contract and legal in the most subtle ways (No surprise: animation
information as well as few links to the main sections effects sneaked into this years web design trends
of the site. list yet again).
Whitespace, it is also called as negative space and
refers to any area of page that is not covered by REPETITION
type or illustrations. The exact same applies to creative pieces.
Repeating the same element over and over again
creates a pattern that is highly satisfactory to the As with the body, UX design is the first step: before
eye. you make your site look good, you have to make
sure it works the way it’s supposed to and enables
HIERARCHY your visitors to accomplish their goals, whether
Great composition splits elements into three levels that’s learning more about your company,
of hierarchy: the most important, the middle stuff, contacting someone, or making a purchase.
and the least important. The reason being that the
human brain can’t grant the same level of Once the UX is in place, the UI creates an inviting
importance to every element in a story, spectacle or and engaging framework than makes interacting
composition. Rather, it tends to place more with your site an aesthetically pleasing experience
importance on the first elements that it perceives for users.
and this is where great artists want to center their
viewers’ attention. JAVASCRIPT VARIABLES
Variable can have a short names, like x and y, or
UNITY more descriptive names, like age, sum, or, total
This principle is about finding the right balance with volume.
the right elements. To achieve this harmonious
feeling, the designer needs to make sure that every JAVASCRIPT VARIABLES - STORED IN RAM
item has a specific place and role in the
composition.

UI (User Interface)
UI refers more to the appearance or presentation of
a website than the way someone
might use it, including colors, layout, typography,
and other design elements. DECLARING JAVASCRIPT VARIABLES
A website with good UI will:
• Be aesthetically pleasing
• Have an attractive color scheme
• Employ typography that is pleasant to look at and
easy to read
• Feature a balanced, uncluttered layout with
adequate white space
• Use a clear visual hierarchy to show visitors
where they are on the site
• Utilize design elements that are familiar to users
so they know how to complete their
desired actions
MULTIPLE VARIABLES
HOW UX AND UI WORK TOGETHER
To fully understand the relationship between
website UI and UX, it may be helpful to think of a
website like a human body. The body’s UI is its
appearance: size, shape, clothing, cosmetics,
anything that makes up the overall visual
impression of the person. The UX is what’s going
on under the skin: the organs and systems of the
body and how they function to keep the person JAVASCRIPT DATA TYPES
alive and healthy.
TYPEOF OPERATOR
The typeof operator is a unary operator that is
placed before its single operand, which can be of
any type. Its value is a string indicating the data
type of the operand.

The typeof operator evaluates to "number",


"string", or "boolean" if its operand is a number,
No need to explicitly define the data types
string, or boolean value and returns true or false
based on the evaluation.

Here is a list of the return values for the typeof


Operator.

MISCELLANEOUS OPERATOR
We will discuss two operators here that are quite SAMPLE CODE
useful in JavaScript: the conditional operator (? :)
and the typeof operator
Conditional Operator (? :) - The conditional
operator first evaluates an expression for a true or
false value and then executes one of the two given
statements depending upon the result of the
evaluation.
? : (Conditional ) - If Condition is true? Then value
X : Otherwise value Y

SAMPLE CODE

JAVASCRIPT FUNDAMENTALS
JavaScript is a lightweight, interpreted
programming language. It is designed for creating
network centric applications. It is complimentary to
and integrated with Java. JavaScript is very easy to
implement because it is integrated with HTML. It is
open and cross platform.
Why to Learn JavaScript
Javascript is a MUST for students and working
professionals to become a great Software Engineer
specially when they are working in Web
Development Domain. I will list down some of the document. In this case, you would not have any
key advantages of learning Javascript: function defined using JavaScript.

• Javascript is the most popular programming


language in the world and that makes it a
programmer’s great choice. Once you learnt
Javascript, it helps you developing great front end
as well as back end softwares using different
Javascript based frameworks like jQuery, Node.JS
etc.
• Javascript is everywhere, it comes installed on
every modern web browser and so to learn
Javascript you really do not need any special
environment setup. For example Chrome, Mozilla
JavaScript in <body> and <head> sections
Firefox , Safari and every browser you know as of
• You can put your JavaScript code in <head> and
today, supports Javascript.
<body> section altogether as follows
• Javascript helps you create really beautiful and
crazy fast websites. You can develop your website
with a console like look and feel and give your
users the best Graphical User Experience.
• JavaScript usage has now extended to mobile
app development, desktop app development, and
game development. This opens many opportunities
for you as Javascript Programmer.
• Due to high demand, there is tons of job growth
and high pay for those who know JavaScript. You
can navigate over to different job sites to see what
having JavaScript skills looks like in the job market.
• Great thing about Javascript is that you will find
JavaScript in External File
tons of frameworks and Libraries already
As you begin to work more extensively with
developed which can be used directly in your
JavaScript, you will be likely to
software development to reduce your time to
find that there are cases where you are reusing
market.
identical JavaScript code on
JavaScript in <head>...</head> section
multiple pages of a site.
• If you want to have a script run on some event,
such as when a user clicks somewhere, then you
You are not restricted to be maintaining identical
will place that script in the head as follows
code in multiple HTML files.
The script tag provides a mechanism to allow you
to store JavaScript in an
external file and then include it into your HTML
files.
Here is an example to show how you can include
an external JavaScript file in your HTML code using
script tag and its src attribute
JavaScript in <body>...</body> section
• If you need a script to run as the page loads so
that the script generates content in the page, then
the script goes in the <body> portion of the
Statement(s) to be executed if expression is true
} else {
To use JavaScript from an external file source, you Statement(s) to be executed if expression is false
need to write all your JavaScript source code in a }
simple text file with the extension ".js" and then Here JavaScript expression is evaluated. If the
include that file as shown above. resulting value is true, the given statement(s) in the
For example, you can keep the following content in ‘if’ block, are executed. If the expression is false,
filename.js file and then you can use sayHello then the given statement(s) in the else block are
function in your HTML file after including the executed.
filename.js file.
IF...ELSE IF… STATEMENT
The if...else if... statement is an advanced form of
if…else that allows JavaScript to make a
correct decision out of several conditions.
Syntax
The syntax of an if else if statement is as follows:
if (expression 1) {
JAVASCRIPT VARIABLES Statement(s) to be executed if expression 1 is true
Note − Use the var keyword only for declaration or } else if (expression 2) {
Statement(s) to be executed if expression 2 is true
initialization, once for the life of any variable name } else if (expression 3) {
in a document. You should not re declare same Statement(s) to be executed if expression 3 is true
variable twice. } else {
Statement(s) to be executed if no expression is true
JavaScript is untyped language. This means that a }
JavaScript variable can hold a value of any data
type. Unlike many other languages, you don't have There is nothing special about this code. It is just a
to tell JavaScript during variable declaration what series of if statements, where each if is a part of the
type of value the variable will hold. The value type else clause of the previous statement. Statement(s)
of a variable can change during the execution of a are executed based on the true condition, if none of
program and JavaScript takes care of it the conditions is true, then the else block is
automatically. executed.
Example:
IF STATEMENT Try the following code to learn how to implement an
The if statement is the fundamental control if else if statement in JavaScript
statement that allows JavaScript to make decisions
and execute statements conditionally. SWITCH CASE
Syntax: You can use multiple if...else…if statements, as in
The syntax for a basic if statement is as follows the previous chapter, to perform a multiway branch.
if (expression) {
Statement(s) to be executed if expression is true
However, this is not always the best solution,
} especially when all of the branches depend on the
Here a JavaScript expression is evaluated. If the value of a single variable.
resulting value is true, the given statement(s) are Starting with JavaScript 1.2, you can use a switch
executed. If the expression is false, then no statement which handles exactly this situation, and
statement would be not executed. Most of the it does so more efficiently than repeated if...else if
times, you will use comparison operators while statements.
making decisions. The objective of a switch statement is to give an
IF … ELSE STATEMENT expression to evaluate and several different
The 'if...else’ statement is the next form of control statements to execute based on the value of the
statement that allows JavaScript to execute expression. The interpreter checks each case
statements in a more controlled way. against the value of the expression until a match is
Syntax found. If nothing matches, a default condition will
if (expression) { be used.
switch (expression) { or code block repeatedly as long as an expression
case condition 1: statement(s)
break; is true. Once the expression becomes false, the
case condition 2: statement(s) loop terminates
break;
...
case condition n: statement(s) Syntax
break; The syntax of while loop in JavaScript is as
default: statement(s)
follows :
while (expression) {
The break statements indicate the end of a Statement(s) to be executed if expression is true
}
particular case. If they were omitted, the interpreter
would continue executing each statement in each
of the following cases. DO… WHILE LOOP

JavaScript provides full control to handle loops and The do...while loop is similar to the while loop
switch statements. There may be a situation when except that the condition check happens at the end
you need to come out of a loop without reaching its of the loop. This means that the loop will always be
bottom. There may also be a situation when you executed at least once, even if the condition is
want to skip a part of your code block and start the false.
next iteration of the loop. Syntax:
To handle all such situations, JavaScript provides The syntax for do while loop in JavaScript is as
break and continue statements. These statements follows
do {
are used to immediately come out of any loop or to Statement(s) to be executed;
start the next iteration of any loop respectively. } while (expression);

The break Statement


The break statement, which was briefly introduced FOR LOOP
with the switch statement, is used to exit a loop
early, breaking out of the enclosing curly braces The 'for' loop is the most compact form of looping. It
includes the following three important parts
The continue statement tells the interpreter to
immediately start the next iteration of the loop and The loop initialization where we initialize our
skip the remaining code block. counter to a starting value. The initialization
When a continue statement is encountered, the statement is executed before the loop begins.
program flow moves to the loop check expression
immediately and if the condition remains true, then The test statement which will test if a given
it starts the next iteration, otherwise the control condition is true or not. If the condition is true, then
comes out of the loop. the code given inside the loop will be executed,
otherwise the control will come out of the loop.
THE WHILE LOOP
While writing a program, you may encounter a The iteration statement where you can increase or
situation where you need to perform an action over decrease your counter.
and over again. In such situations, you would need
to write loop statements to reduce the number of You can put all the three parts in a single line
lines. separated by semicolons.
JavaScript supports all the necessary loops to ease The syntax of for loop is JavaScript is as follows
for (initialization; test condition; iteration statement) {
down the pressure of programming. Statement(s) to be executed if test condition is true
}
The while Loop
The most basic loop in JavaScript is the while loop FUNCTION
which would be discussed in this chapter. The A function is a group of reusable code which can be
purpose of a while loop is to execute a statement called anywhere in your program. This eliminates
the need of writing the same code again and again. Syntax
It helps programmers in writing modular codes. The basic syntax is shown here.
<script type = "text/javascript">
Functions allow a programmer to divide a big <!
program into a number of small and manageable function functionname(parameter
list) {
functions.
statements
Like any other advanced programming language, }
JavaScript also supports all the features necessary //
</script>
to write modular code using functions. You must
have seen functions like alert() and write() in the
THE RETURN STATEMENT
earlier chapters. We were using these functions
A JavaScript function can have an optional return
again and again, but they had been written in core
statement. This is required if you want to return a
JavaScript only once.
value from a function. This statement should be the
JavaScript allows us to write our own functions as
last statement in a function.
well. This section explains how to write your own
For example, you can pass two numbers in a
functions in JavaScript.
function and then you can expect the function to
return their multiplication in your calling program.
JavaScript is by using the function keyword,
followed by a unique function name, a list of
parameters (that might be empty), and a statement
USING LABELS TO CONTROL FLOW
block surrounded by curly braces.

Starting from JavaScript 1.2, a label can be used


Syntax:
The basic syntax is shown here. with break and continue to control the flow more
<script type = "text/javascript"> precisely. A label is simply an identifier followed by
<!
a colon (:) that is applied to a statement or a block
function functionname(parameter
list) { of code. We will see two different examples to
statements understand how to use labels with break and
}
//
continue.
</script> Note − Line breaks are not allowed between the ‘ or ‘
statement and its label name.
FUNCTION PARAMETERS Also, there should not be any other statement in
Till now, we have seen functions without between a label name and associated loop.
parameters. But there is a facility to pass different Try the following two examples for a better
parameters while calling a function. These passed understanding of Labels.
parameters can be captured inside the function and
any manipulation can be done over those
parameters.
A function can take multiple parameters separated
by comma

Function Definition
Before we use a function, we need to define it. The
most common way to define a function in
JavaScript is by using the function keyword,
followed by a unique function name, a list of
parameters (that might be empty), and a statement
block surrounded by curly braces.

You might also like