Friday 17 June 2016

Unit 20 – M2: Discuss how a scripting language can improve functionality


Unit 20 – M2: Discuss how a scripting language can improve functionality


Introduction


It is essential that websites function and the functionality of websites in this day and age are of a high standard. There are various things that could improve the functionality of a website, one of them being the type of scripting used; either client side scripting or server side scripting. So therefore in this report I will be focusing on describing how the scripting language can improve the functionality of a website, alongside comparing the benefits of client side scripting to server side scripting and describe how client side scripting can improve user experience and validation in a website.

Client side scripting


This is an essential part of HTML as it enables the scripting of webpages which then makes the webpages have different content/reactions depending on what the user inputs and other variables. Client side scripting is simply websites or web programs that execute on the clients computer/client side, which is for example on the clients web browser. Instead of executing on the webserver. The script is mostly written in the HTML document of the website which makes it an embedded script however, it could be written in a separate file. Client side scripting simply works by transferring the source code of the web page from the web server it is stored on to the client’s web browser; these source codes contains all the information and instructions; like the action that happens when a button is clicked.

Server side scripting


Server side scripting is simply a scripting technique that customises the webpage for the user upon their request to the server. This is done by adding a script on a web server and this script creates a response specific to the user. This is written in languages such as server side JavaScript, Python, PHP and executes on the web server.



User experience


Like I have mentioned in the introduction of this report, websites functionality can be improved with the use of scripting languages. Web designers improve the user experience of the website using scripting languages like JavaScript. JavaScript helps with interactivity and the fact that users only come in contact with the finished product/front-end part of the website, JavaScript will help improving the user’s experience. Making the website adaptive to the user’s device will improve the users experience for example, viewing a website on a desktop and viewing it on a tablet will be different due to their screen sizes. JavaScript could be used in order to make the content of the website adapt to the devices so the user can view it without any problems.

Users having control over their webpage due to interactivity improves their user experience. The scripting language that supports interactivity which can help in improving user experience is JavaScript. JavaScript can be used to create pop up boxes that give the user information for example, when the user clicks on “next” when filling a form, if the user misses an important slot there could be a pop up box alerting them to where the mistake is. This improves the users experience as they know where the issue is rather than having to scan through the entire webpage to spot the issue.

Scripting languages can bring about widgets like a timer or clock to websites, which improves the functionality of the website. The user will be able to view the real time while browsing on the webpage improves the functionality of that webpage slightly as the user will not have to look elsewhere. This makes the entire site user friendly.

Scripting languages help in gathering information about the visitors of the website and the information is then used to improve the website. This is known as Web analytics which is done using JavaScript and also a server in order to collect the information and analyse the information.This work by using cookies to track the user’s usage of the site, this information when derived can then be used in improving the website and make the user experience better and entire functionality of the website.

JavaScript can be used in creating rollover buttons which can make a single button have various states. Having rollover buttons on a webpage helps in improving the user experience as it makes them aware of where their cursor is, if its hovering over the button or not.

Validation


Validation is key when it comes to websites especially form validation for various reasons like the information not being correct. Scripting languages can be used in validation. The datatype of the information entered by the user can be detected using JavaScript and if the datatype is not allowed in the text box then there could be an alert. This ensures the data integrity which improves the validation. An example of this would be, client side scripting not enabling the user to type in and submit alphabet in the text box of phone number.

Using client side scripting for validation of websites is beneficial as the validation is carried out on the user’s device/browser makes the process rapid, due to the fact that the request doesn’t have to be made to the server to carry out validation on the form.    

Comparing the Advantages of Server side and Client side scripting


Server Side Scripting
Client Side Scripting
Using server side scripting could be seen as beneficial due to the fact that unlike Client side scripting Server side reduces load on the user’s device, as we know the language is stored on the server and request is made to the server then information is passed to the user which means all the load and work is on the server side. Using Client side scripting on the other hand means that the script is copied to the user’s device and ever request is fulfilled on/by the device which means load on the device and if the device is slow/old then it will reduce the speed and user experience. However, based on the internet speed of the user using server side could also be slow.
Server side takes care of various processes like payment, menus and database queries.
Using client side scripting means that a lot of things can be done in a short period of time. This is because it executes on the device and doesn’t need to request to the server and wait for a response. This is beneficial as the user will have a better experience due to the fact that they do not have to wait to perform certain actions. Unlike server side which simply requires request to the server in order for performed actions to be fulfilled.
Server side scripting does not depend on browsers or special plug-ins to function. This means that whatever browser is being used by the user, the website will functionality and user experience will be at its best as the website will be efficient. This when compared to Client side scripting in this context is beneficial as client side highly depends on plugins and browsers which mean that the usability might be decreased if the users web browser does not support scripts.
Client side scripting may improve the usability of the website for users, this is only if the user’s website supports script. Using Client side scripting could improve the users experience as it allows for more interactivity. Using server side could also allow interactivity however, it is less immediate which reduces the user experience as it will take a longer time to interact with the website due to the server trips.  





References


Wikipedia. (2016). Client-side scripting. [online] Available at: https://en.wikipedia.org/wiki/Client-side_scripting [Accessed 15 Jun. 2016].

Wikipedia. (2016). Server-side scripting. [online] Available at: https://en.wikipedia.org/wiki/Server-side_scripting [Accessed 15 Jun. 2016].

Sqa.org.uk. (2016). Differences between Client-side and Server-side Scripting. [online] Available at: http://www.sqa.org.uk/e-learning/ClientSide01CD/page_18.htm [Accessed 15 Jun. 2016].

M2 - Describe the purpose and function of JavaScript and JQuery


M2 - Describe the purpose and function of JavaScript and JQuery


Introduction


When developing a website, there are various things involved. There is the design/presentation and also the coding that goes with it. Websites are mostly made for audience to access and use so therefore they have to be responsive and cater for the user’s device. JavaScript possesses many of the features of a programming languages however it is not a programming language. It is a key tool used in web design for various reasons and also Jquery is also often an essential tool when creating a website. This document will be covering the purpose and the functions of JavaScript and Jquery the scripting languages used in web design.

JavaScript


JavaScript is simply a scripting language used for creating interactive websites. JavaScript in websites are used for situations where validation is required and also to make the webpage interactive.
This is a client side language which means it functions on the user's computer and does not have anything to do with the server of the website. IT DOES
JavaScript works with the browser and is executed by the browser which means that there is no required software application needed to run it. JavaScript is used in validation of pages and a prime example is the error pop up messages given when you miss out a mandatory part of an online form. JavaScript is popular due to the fact that it is widely supported by all the browsers available. In Currently with the advancement of technology, users mostly access websites on their portable devices like phones and tablets and JavaScript is used in websites in order for the website to adapt and render the site to the sizing of the screen of the device being used to access the website. Also websites are mostly made for the purpose of giving information, marketing and also e-commerce which means that the users will have to interact with the website in order to shop or gain information and JavaScript is used to create the interactive features in the website like slideshows and dropdown box that helps in navigation.
JavaScript has similiarities to other programming language to an extent, an example of how it is similar to programming languages is the fact that it has features like variables, IF statements etc. Using conditional statements like IF statements allows the developer to use JavaScript for validation and a validation could be if a firstname on a form page is blank, a pop up alert message will display to alert the user of this error.
JavaScript is not capable of formatting the users hard disk unlike programming language which is capable of doing so. This is a high risk when it comes to languages that execute on the users computer so JavaScript is safe when it comes to the language affecting the users data integrity. 

JQuery


JQuery is a pre-coded JavaScript; this can be referred to as a library where JavaScript is stored for web designers to use. This mainly stores open-source JavaScript. JQuery enables the developer to easily utilise open-source JavaScript available which is one of the main purpose of JQuery. JQuery saves time when developing a website as it enables the web designer to utilise JavaScript's fast without having to write out the code and this reduces the chances of making any sort of error. This also allows the developer to include the basic JavaScript available in the Jquery quickly without having to always retype it as it can be called upon by the developer. The lines of code that comes from JQuery is laid out in a simple and short manner which makes it easier to understand the code and spot any errors or unwanted code.

Example of code


JavaScript


Function changeBachground(color) {

        Document.body.style.background = color;

}

Onload=”changeBackground (‘blue’);”

jQuery


$ (‘body’) .css (‘background’, ‘#ccc’);
Reference
W3schools.com. (2016). JavaScript Tutorial. [online] Available at: http://www.w3schools.com/js/ [Accessed 17 May 2016].
W3schools.com. (2016). jQuery Tutorial. [online] Available at: http://www.w3schools.com/jquery/ [Accessed 17 May 2016].
Wikipedia. (2016). JQuery. [online] Available at: https://en.wikipedia.org/wiki/JQuery [Accessed 18 May 2016].