Thursday, 9 May 2013

Unit 20 - P3 M2


P3 Explain the fundamentals of a scripting language &
M2 discuss how a scripting
language can improve
functionality

What is a scripting language?

A scripting language is a type of high-level programming language that when executed is interpreted by another program such as a Browser at the very beginning rather than compiled by the computer's processor. Some of the most popular used scripting language include: JavaScript, Python and VBScript.

Client / Server scripting 

Scripting languages can be embedded within HTML, it’s normally used to add functionality to a Web page, for example; different menu styles or graphic displays or to serve interactive advertisements. These types of ‘languages’ are client-side scripting languages; this is because it affects the data that the person behind the computer screen sees in a browser window.

Server-side scripting languages on the other hand actually manipulate the data from the source, for example a product description in a database which is on the server. So client-side scripting only affects a specific user once activated, for example: rolling the cursor over a navigation button – that person would see that the button high-lights and not everyone else would see that change unless they follow the exact same actions. Server-side scripting would affect everyone visiting the website immediately. Things such as product description on an e-commerce website; once change from the server everyone visiting that website would see the changed description.

A scripting language is different from a programming language in the sense that a command can be used in a scripting language and executed straight away whereas a programming language translates the command into a readable format which the system then runs. For example a PC game where programming languages such as C++ is used this is because games require high levels of programming that can’t be executed immediately and need to be compiled by such programming languages. Simple tasks on the other hand such as high-lighting a button or browser-detection to find out what browser the user is using and adjust the website code accordingly.


Client Side

In Client side the scripting does all the calculations on the user's computer. The web browser or a plugin reads the script and converts it into a visual web page.Most of the information that the user enters into the website stays in the client side and sometimes sent back to the server.

Client Side advantages 

  • Allow for more interactivity by immediately responding to user's actions 
  • May improve the usability of web sites for users who's browsers support scripts 
  • Can give developers more control over the look and behavior of their web widgets 
  • Secure as it is protected which means it is not possible to read by users, prevents it from being stolen

Client Side disadvantages

  • Not all browsers support scripts therefore users might experience errors if no alternatives are provided
  • Different browsers and browser versions support scripts differently thus more quality testing is required
  • More development time and effort might be needed



JavaScript 

JavaScript is a scripting language that was developed by Netscape to enable web creators to design interactive sites. JavaScript is an open language that anyone can use without having to buy a license. One of the tasks that JavaScript is able to do is that it can interact with the HTML code of a website which enables website creators to put in dynamic content in their sites. All browsers today support JavaScript as it is a crucial part of our everyday browsing experience. We may not notice it but it’s on nearly every website; from e-commerce websites such as amazon and e-bay to watching videos on YouTube. For example with JavaScript you can add animations to a website to attract customers and if the user clicked on the animation it could take them to a certain page on the website. In conclusion, JavaScript allows people to build highly responsive user interfaces, prevent frustrating page reloads and even fix issues for CSS.


jQuery 

What is jQuery? jQuery is not a language, but instead is a well written JavaScript code. jQuery almost simplifies basic tasks that you would want to happen in a web browser. It is very useful because the simple things such as making a pop-up box appear in a website when a button is pressed could be written in as little as 2/3 lines of jQuery whilst in JavaScript it would take a whole page of coding. This is because it is its own library where it stores all the information related to jQuery so that you do not need to define each and every single aspect. jQuery helps to implement user interface related functionality without having to write hundreds of lines of codes, in other words; it’s simple, clean and fast.

References:
JavaScript, 09/05/2013, http://bit.ly/93VJ
Client side vs Server side, 09/05/2013, http://bit.ly/10fA4RK