Powered By Blogger

Thursday 13 June 2013

U20 M2

M2 - Discuss how a scripting language can improve fuctionality
 

What is a Scripting Language?




A scripting language is a high-level programming langauage that allows intergration and communication with other programming languages, the most commonly used scripting language is JavaScript, but there are many others such as Perl, Ruby, VBScript etc. A scripting language is normally used alongside other programming languages such as HTML.
 
What do they do?
 
A scripting languages are not compiled like a programming language but it is interpreted by the browser, one command at a time. These are normally used to add and increase the functionality and interaction to a webpage, an example of one of these languages is JavaScript which was created by a company called Netscape with the intention to increase functionality as HTML alone was not capable of providing it. Without Scripting languages there would be no interactivity on the webpage, so there would be no search bars or the ability to submit forms via the website.

What is client side and server side?
The client is the system on which the Web browser is running, therefore the users side. JavaScript is the main client-side scripting language that is used for the Web. Client-side scripts are interpreted by the browser. The process of client-side scripting is:
 
1. The user first requests a Web page from the server
2. the server finds the page and sends it to the user
3. the page is displayed on the browser with any scripts running during or after display
 
Client-side scripting is used to allow web pages change after have been delivered. It is useful as it allows pages to be more interactive and allow other functions to be inserted.

The server is where the Web page and other content is stored. The server sends the pages that are requested by the user/client on request. The process of server side scripting is:
 
1. the user requests a Web page from the server
2. the script in the page is interpreted by the server creating or changing the page content to suit the user and the occasion and/or passing data around
3. the page in its final form is sent to the user and then cannot be changed using server-side scripting
 
Server-side scripting tends to be used for allowing users to have individual accounts and providing data from databases.
What is JavaScript and what it is used for?
JavaScript is a programming language that is used to make web pages interactive. It can be used to improve the functionality of a website by adding client side interaction. It runs on your users computer and doesn't require constant downloads from your website. JavaScript is often used to create polls and quizzes.
What is JQuery and what is it used for?
JQuery is a library that makes it quicker and easier to build JavaScript WebPages and web apps. Often with JQuery you can write a single line of code to achieve what would have taken 10-20 lines of regular JavaScript code.
JQuery is itself written in JavaScript, and comes in the form of a single .js file that you link to from your webpage. Your JavaScript code then accesses the library by calling various JQuery functions.
Validation
Scripting languages such as JavaScript can be used to validate data in HTML forms before sending the content back to the server. Therefore the validation is completed on the clients side saving the server processing power as it does not have to validate the information imputed in forms.

Examples of the data that normally checked by a JavaScript could be:
- has the user left required fields empty?
- has the user entered a valid e-mail address?
- has the user entered a valid date?
- has the user entered text in a numeric field?

 
Websites such as Facebook and Amazon use it to check if a email and password has been entered before checking the data.
GUI
A graphical user interface is a program interface that takes advantage of the computers graphics to make the program easier to use. A well designed GUI can free the user from learning complex commnad languages. Whereas on the other hand, many userd find that they work more effectively with a command-driven interface, especially if they know the command language. They use windows, icons and menus to carry out commands such as opening, deleting and moving files. They are often used for computers, mobile devices and portable games consoles. 

As scripting languages such as JavaScript add functionality to webpages creating better and easier to use GUI. Interacticity on webpages allows users to navigate and use the website easier, space on webpages can be more effectively used on webpage with the use of dropdown menus as less space in required having many links to individual pages when they could all be listed in a drop down menu.

References: