Criteria

Tuesday 18 June 2013

P3: Explain the fundamentals of a scripting language


A scripting language is a tool which is used for functionailty to other software. The programming languages that use scripting languages are Javascript, PHP, Python, etc. It is designed for the purpose of creating simple tasks.An example could be when a user types a product name into a search bar and the computer displays the most relevant items on the website. It is a message from the user to the computer. Interactivity is not only useful but it is now expected by customers. Static websites have only fixed information on it, if it is to be changed then the designer needs to change the code and then upload the amended page to the web server. These websites are seen as old fashioned and useless because it wastes a lot of time.

Today, users prefer using dynamic websites where it is updated live online, usually there are scripting languages or databases. Dynamic websites are easy to maintain once they go live on the internet, this means once a website is uploaded to be viewed on the internet.

A scripting language is normally used in conjunction with another programming language, because of this you will often find it alongside Java. It is easier to write the code in a scripting language than in a recorded language. However, scripting language are slower because the instruction are not handled solely by the basic instruction processor. A normal programming language such as C++ is collected into an executable file, however a scripting language reads one command at a time rather than being collected

Scripting languages are mainly used to add functionality and interaction to a webpage. JavaScript is a interpreted computer programming language, which was created by Netscape. It was originally designed as part of web browsers so that client side scripts could interact with the user, control the browser and alter the document content that was shown. JavaScript was created with the exact purpose since HTML did not have the capability of providing the full experience of interactive websites alone, so JavaScript was joined to make the websites interactive

The main difference with a scripting language and a programming language is the way they are used. Scripts are typically quick whereas a programming language is meant to be more thought out and deliberate. Scripting languages are languages that do not need complication. A script is code part, rather than a complete or standalone application. An example includes code in a webpage.
 
Client Side Scripting
Client side scripting is used to make web pages change after they arrive at the browser. It is useful for making web pages a bit more interesting and user friendly. It can provide useful gadgets such as calculators, clocks, etc. As the code is being executed on the user’s computer, a possible entry point for hackers is opened up.
 
Server Side Scripting
Server side scripting is often used for allowing users to have individual accounts and providing data from databases. It allows a level of privacy, personalisation and provision of information that is very powerful. E-commerce and social networking sites all rely on server side scripting to keep information safe.

Javascript
JavaScript is an interpreted computer programming language. It was originally made as part of web browsers do that client side script could interact with the user, control the browser, and alter the document content that was displayed.  JavaScript is a scripting language and it gas a wide range of applications including e-commerce and advertising networks such as Google AdSense.

JavaScript plays a obvious role in displaying adverts on websites. It controls which ads are displayed and may set a cookie on your computer which indicates you have seen the advert, JavaScript is also used to open windows for pop up adverts unless your browser restricts it.JavaScript is extensively used for e-commerce sites. It plays a huge part is such tasks such as adding items to your shopping cart, processing forms and submitting orders to be shopped. It can also be used to show dynamic content to users while shopping such as related items you have seen.

JavaScript is also used to display simple alerts to users for example if you fill out a form and type in a invalid address, an alert will appear saying there has been a mistake. JavaScript is also used for security. Some login systems need you to type in your password using a onscreen keyboard.

jQuery
jQuery is a coding language that is from JavaScript. jQuery works like JavaScript where it is used to help with interaction and effects with your development code. jQuery hasn’t been around for a long time, it was released in the year 2006 and the only version is 1.4.0. jQuery is new and an exciting technology which catches on quickly and makes the internet more interactive and enjoyable. With jQuery, you can accomplish effects with less code that it would take with JavaScript. Most common jQuery effects are drop down menus, drag and drop elements, animation and form validating. Developers have connected his with other coding language such as JSP, ASP, PHP, and CGI

With languages that are event driven, the code is broken in to events so it could be any action for example the most used one is the click of the mouse. When the mouse is clicked then the code is triggered into running when the action happens Events are actions, which script sense, and when it is sensed a reaction occurs. Events can include a mouse button being clicked or a keyboard key being pressed. Old browsers do not support scripting languages. Browsers that can interpret will see the <script> tags and interpret the code between them. Browsers that cannot interpret the script will ignore the script tags and also the HTML comments
















P2: Explain The Features of The Box Model For CSS


P2: Explain The Features of The Box Model For CSS 

The CSS box model describes the boxes that are made in the content of a web page. Every element in the web page is in a box or is a box, even if it is an image. The boxes on the web pages are constrained by rules which are given by the box model

There are four parts of the box model which are shown below.

1.       Margin

2.       Border

3.       Padding

4.       Content

The four parts of the box model are explained in more detail below:

Margin:  the margin is the area around the border. The margin does not have a background, it is completely transparent.
Border: The border is the next thing surrounding the box and is below the margin. Borders can be coloured or transparent. If the border format is set to 0 then it disappears and the border will be the same as the padding edge

Padding: The padding is the space between the content and the border. Padding is tghe same colour as the background colour of the box. If the padding format is set to 0 then the padding border will be the same as the content border

Content: The content is the last part of the box model and this is where the text or an image is displayed.

   
You can edit different parts of the box model with the CSS properties such as:
  • Margin
  •  Border
  • Padding
  • Width
  • Height

The border of the box model can be edited with CSS and some examples of this is shown below:

Border width: You can edit this to made the width thick or thin and you can choose how thick or think you want it with the code ‘border-width:1;’

Border style: you can edit this by choosing a variety of patterns for the box such as dotted, dashed, inset, outset, solid, etc. This can be shown in CSS like ‘border-style:dotted;’

Border color: you can edit this by choosing any color such as aqua, blue, etc. This can be shown as ‘border-color:#Blue;’

The width and the height can be changed to how big you want the box to be. The coding for this would be ‘width:100%; and for height it would be the same but the width would be changed to height ‘height:100%;

Padding: the padding helps you choose where you want the position to be of the box. An example of this could be: ‘padding:50px; or ‘padding: top right;

The last thing that could be edited is the margin. The margin is slightly the same as the padding but the coding is changed for example ‘margin:all; or margin:25px;’
All of this can done by div tags. A div tag defines a section in a HTML document, this is used to group elements to make them format with CSS. Div tags help make a page that is easy to manage and change later when needed. An example of a div tag being used in a html file and a style sheet are shown below:
HTML
<div class="a">Raja Kang</div>
 
In a Style Sheet:
.a{
background:pink;
color:green;
width:50px;
height:50px
text-align: center;
float:right;
}
 
Bibliography

http://www.css-101.org/the_box_model.php

http://webdesign.about.com/od/beginningcss/p/aacss6box.htm

http://www.w3schools.com/tags/tag_div.asp

http://webdesign.about.com/od/htmltags/qt/tipdivtag.htm