Professional Documents
Culture Documents
BTEC Assignment Brief: Qualification Unit Number and Title Learning Aim(s) Assignment Title Assessor Issue Date
BTEC Assignment Brief: Qualification Unit Number and Title Learning Aim(s) Assignment Title Assessor Issue Date
BTEC Assignment Brief: Qualification Unit Number and Title Learning Aim(s) Assignment Title Assessor Issue Date
Qualification
(For NQF
only)
Assignment title
Assessor
Issue date
Task 1
Checklist of evidence
required
Unit/Criteria
To achieve the criteria you must show that you are able to:
reference
Unit 20: P1
Unit 20: P2
Task 2
Checklist of evidence
required
Criteria covered by this task:
Unit/Criteri
To achieve the criteria you must show that you are able to:
a reference
P3
M1
M2
D1
Sources of information
to support you with
this Assignment
Other assessment
materials attached to
this Assignment Brief
N/A
FOR NQF LEVEL 2 ONLY: If you have not achieved the Level 2 criteria, your work
will be assessed to determine if the following Level 1 criteria have been met.
Criterion
To achieve the criteria you must show that you are able to:
Unit
reference
ofStyle
JavaScript
CSS The
stands basics
for Cascading
Sheets. CSS is used to define styles for your
web pages, including the design, layout and variations in display for different
devices
screen
The
basicand
things
that sizes.
you must have knowledge on are: the syntax, variables,
CSS is properties,
linked to html
in threemethods,
different ways,
the main
being creating a link to
objects,
functions,
constants
and events.
an external style sheet within the html known as external CSS. Both the link
to the style sheet and the syntax that you need to use within the style sheet are
Syntax
shown below.
Case sensitivity
It is important to make sure that you have the correct capitalisation when coding
in JavaScript as the language is case sensitive and having a line of code that
requires a capital letter or vice versa can cause the code to not work properly or
at all.
CSS can also be used within the html document in the form of inline meaning
Comments
that it is all on one line within the style tag. As shown below:
Comments in can be used in two ways, a one-line comment which is declared by
using
two forward
(//)be
as implemented
shown below.into html is in the form of
The third
way thatslashes
CSS can
internal, using a similar format as is used in an external style sheet however
The
way
is a multi-line
which
declared
by beginning the
the other
CSS is
defined
by usingcomment
the style tag.
Asisshown
below:
comment with a forward slash along with an asterisk (/*) and ending the
comment with an asterisk followed by a forward clash (*/) as shown below.
Variables
There are two ways to declare variables in JavaScript; the correct syntax for the
first method is to declare the variable using the var keyword
by the
The followed
Box Model
name of the variable and ending the line
a semicolon
thenison
a lineto the left of
Anwith
image
of the boxand
model
shown
below assigning the values by stating the
followed
bybox
an equals
thisvariable
text. In name
the center
of the
you have the
sign and then the value which can be either
a
string,
numerical
value
or
boolean,
content which determines the height
and width
if the value is a string you enclose the string
either
single
quote
marks
or
double
that the image or text will be, outside of that you
quote marks and if the value is a number
or apadding,
booleanwhich
then you
dont
use quote
have
is the
spacing
between the
marks, the statement is then ended withcontent
a semicolon
as
shown
below.
and the next layer which is the border,
which can have a variety of different colours,
border widths and styles e.g. solid, dotted etc.
After the border you have the margin which
determines the position of the element on the
page. The different selectors that are used are:
width, height, padding, border and margin. You
would use the box model to style a section of text
to your liking.
Functions
There are two ways to declare functions, these being to declare the function all
on one line or have it separated onto multiple lines so that it is easier to read. You
begin with the function keyword then provide a name and then an opening
bracket to define the parameters that the function will accepted that are
separated using a comma and then close the parameter section with a closing
bracket and open the code that is to be ran when the function has been called
with an opening brace ({) and then close off that section of code with a closing
brace (}) followed by a semi colon. In the example below when the function is
called and has the correct parameters entered it will execute the code shown
below where it can then be printed for the user to see.
Methods
There
are
two ways to declare methods, these being to declare the method all on one line
or have it separated onto multiple lines so that it is easier to read. You begin with
the name of the of the property, followed by a colon and then the function
keyword and an opening and closing bracket and then an opening brace ({) to
begin the code that will be run when the method is called and end that section of
code with a closing brace (}). In the example below when the FullName property
of the object Matthew is called then the function is executed where it can then be
printed for the user to see.
Constants
There is only one way to declare a constant, that is to use the const keyword
followed by the name of the constant and then an equal sign after which you
assign the value of that constant and end the statement with a semicolon as
shown below.
Events
There is only one way to declare an event, that is to use a built-in html event
followed by an equals sign and then quotation marks which contain the code for
what you want to happen when that event is triggered. In the example below,
when the cursor has gone over the title element the content within the note
element is changed to the output of the test function.
Variables
A variable is a value that is stored with a name associated with it, unlike a
constant the value that is assigned to a variable can be changed, hence the
name variable.
Objects
An object in JavaScript is any value that is not a string, number or boolean.
Properties
Properties in JavaScript are different characteristics of objects that have values
assigned to them.
Functions
Functions in JavaScript allow sections of code to be predefined elsewhere in the
above code so that the function can be used multiple times later in the code
whenever it is called.
Methods
Methods in JavaScript are functions that are defined as properties of objects,
when you call a method you are accessing the object and requesting the function
under one of the properties to be performed.
Constants
Constants in JavaScript are like variables as you can assign any one of the
following value types: string, number or boolean. However, constants are not
able to be modified later in the code whereas variable can be modified.
Events
Events are triggered when the user or the browser makes a change to the page
that has an event relating to it, when these events are triggered, JavaScript code
can be executed, an example of which would be modifying an element when it is
clicked on.
The
browser
output for
this form is:
(%), when the percentage value is used then the element will be whatever the
percentage value of the container element that it is set to.
Height
The height CSS property allows you to specify the height of a html element. An
example of the height property along with the in-browser output is shown below.
The height property is usually set using a value in pixels (px) or as a percentage
(%), when the percentage value is used then the element will be whatever the
percentage value of the container element that it is set to.
Background Color
The background-color CSS property allows you to specify the background color
of a html element. An example of the background color property along with the inbrowser output is shown below. The background color can be any color as it
supports predefined colors such as: blue, black, white, red etc. as well as the
hexadecimal color selection, rgb color selection and hsl color selection.
Color
The color CSS property allows you to specify the color of the text in a html
element. An example of the color property along with the in-browser output is
shown below. The color can be any color as it supports predefined colors such
as: blue, black, white, red etc. as well as the hexadecimal color selection, rgb
color selection and hsl color selection.
Font
Family
The font-family CSS property allows you to specify the font of the text in a html
element. An example of the font-family property along with the in-browser output
is shown below. The font-family can be any of the predefined web safe fonts or
custom fonts that are linked as a stylesheet.
Border
The border CSS property allows
you to specify the border of a html element. An example of the border property
along with the in-browser output is shown below. The border can be any color as
it supports predefined colors such as: blue, black, white, red etc. as well as the
hexadecimal color selection, rgb color selection and hsl color selection. A few of
the different border styles are: solid, dotted, dashed, double, inset and outset.
Padding
The padding CSS property allows you to specify the amount of space that there
is between the contents of a html element and the border of the element. An
example of the padding property along with the in-browser output is shown
below.
Margins
The margin CSS property allows you to specify the amount of space that there is
between html elements. An example of the margin property along with the inbrowser output is shown below.
Opacity
The opacity CSS property allows you to specify the transparency of html
elements. An example of the opacity property along with the in-browser output is
shown below. There are two ways of adjusting the opacity of a html element,
using either the opacity property or the by using the rgba property when setting
the color or background color of an element. You would use the rgba property
instead of the opacity property when you dont want the child elements to be
affected.
Outline
The outline CSS property allows you to specify add an outline to html elements.
An example of the outline property along with the in-browser output is shown
below. The outline property supports the same styles as the border property,
those being: solid, dotted, dashed, double, inset and outset.
Alerts
Alerts are a popup than notify a user of anything that the web developer wants
then to know, examples of this are: if a user filled in a contact form and pressed
the submit button then an alert notifying them that the message was sent or
failed to send may pop-up, another example could be if a user had entered the
wrong details when attempting to login to an account on that website then an
alert may pop-up to notify that they entered the wrong details. Alerts are useful
and improve functionality by giving a web developer the ability to tell a user
something in relation to their site when the alert is triggered.
Page redirects
Page redirects allow web developers to redirect the users of their website to a
different page, or the same page once the redirect is triggered. Examples of
when page redirects can be used are: when clicking a social media link, when
completing a form and upon submission you may be redirected to a confirmation
of submission page as well as when logging into an account on a website you
would be redirected from the login page to either a home page or your user page.
Cookies
Cookies are text files that contain small bits of information relating to your
browsing session, preferences, etc. They are stored on your computer and allow
web developers to tailor their website to their users. Examples of how cookies
can be used are: storing your name so that when you return to the site you may
have a pop-up that greets you with your name, storing user preferences such as
having certain things enabled or disabled like notifications so that you do not
have to keep enabling or disabling them every time you visit that site and another
thing that cookies can be used for is tracking your search history on that site
which can allow companies that sell different products to suggest other products
that have a similar description to the products that you have searched for or
bought so that it is easier for you to find other things you may be interested in.
Data validation
Data validation is used by web developers to restrict what can be entered and
accepted by the server, examples of which are: making sure that certain fields in
a form contain the correct information i.e. that the email address that is entered
into an email address field contains an at symbol (@) or that the phone number
that is entered into a phone number field only contains numbers and has a
maximum and minimum number of digits, another example would be to tell a
user that one or more of the required fields have not been filled in. By adding
data validation, it allows web developers to cut down on spam or fake email
requests which ultimately results in a faster response to legitimate user
submissions as there will be less fake requests to process.
Form handling
Form handling is process of accessing the data that has been entered a form and
assessing it to determine if it matches the requirements of that form, if it does
then the form data may be sent via email or stored on the website server. Form
handling improves functionality as it allows the web developer to check the data
that has been entered into the form and use it to trigger certain things, i.e. email
the form.
own rendering engine as well as having a few different tags as well as different
features, this can lead to certain things not displaying correctly or functioning
properly, if at all. Web developers can check the features of the browser that the
user is using and specify what code should be executed depending on the
browser that matches the feature that you choose to detect, an example of this is
shown below:
References
http://www.w3schools.com/
http://www.opentechguides.com/how-to/article/javascript/99/browser-detect.html
http://www.quirksmode.org/dom/domform.html