Addition Of Interactive Activities Computer Science Essay

Published:

A scripting language is a programming language that is used to create scripts and codes. These languages are mostly written to help improve features of websites, these scripts will be processed on the server but the scripts will run on the user's browser. The term "script" is quite similar to its meaning in "a movie script tells actors what to do": the language controls the process of a normally program, the script will give the program a series of work to do.

Advantages of scripting language

It's easy to learn and use

The user will only need to know a minimum of programming language

Allows simple making and editing

Allows the addition of interactive activities to web pages

The editing and running code is fast

Disadvantages of scripting language

The scripting language can be slow because it is not compiled into machine code.

Lady using a tablet
Lady using a tablet

Professional

Essay Writers

Lady Using Tablet

Get your grade
or your money back

using our Essay Writing Service!

Essay Writing Service

Can be harder to debug

Most scripting languages are text based so it can be changed by other people

Why modern web pages use JavaScript?

Browser support- To use flash content the user will need to install the flash plug-in on their browser.

But to use JavaScript you don't need to install a plug-in for it, because most web browsers supports java scripts as a scripting language.

The user can use JavaScript to load the page according to the condition of the web browser

JavaScript is a light scripting language, so it can be loaded up on most slow internet connections such as dial ups.

Explain the following features of JavaScript, giving an example of each:

Objects - Javascript has built in objects, some of them are string, array and date.

Events - A Javascript can be execute when an event occur, for example when a user clicks on an HTML element. These events can occur when a user clicks the mouse and when an image has been loaded.

Methods - There are a lot of JavaScript methods, some of them are anchor, apply, big and blind. Each of these methods are different, for example an anchor method places an HTML anchor that has a NAME attribute around text, an apply method applied a method of an object substituting another object for the current object.

Loops - JavaScript loops mostly runs the same code again and again, but every time with a different value.

Functions - JavaScript has many functions some of them are abs and acos. Abs function returns the absolute value of a number, an acos function returns the arccosine of a number.

JavaScript is an object orientated language. Describe what this means.

Is JavaScript object-oriented? The objects in javascripts can contain data and methods that act upon that data. These objects can also contain other objects, but it does not have classes. However these objects have constructors which do what exactly classes do. For example these objects act as containers for class variables and methods. It does not have class-oriented traditions; however it has prototype-oriented traditions.

The two main ways of building up object systems are by inheritance and by aggregation. javascript does both, but its dynamic nature allows it to excel at aggregation.

In my opinion javascript is not object oriented because it does not provide inheritance. however javascripts also supports code reuse patterns as well.

Task 2 - M2

Explain in detail how scripting languages can be used to improve the functionality of web pages.

There are many ways which a scripting language can improve the functionality of a web page. Scripting languages such as javascripts can be embedded within HTML, most web developers used javascripts for graphic displays and to get different menu styles. However some web developers use javascript to serve dynamic advertisements.

Why use Scripting Languages?

Scripting languages are user friendly and easier to handle.

Scripting languages allow the web developers to control more than one applications

Scripting languages has a common gateway interface such as CGI. These scripts allow the web browser to make use of programs running on a web server.

Lady using a tablet
Lady using a tablet

Comprehensive

Writing Services

Lady Using Tablet

Plagiarism-free
Always on Time

Marked to Standard

Order Now

Client side and Server side

Client side

Client side scripting is what happens in your browser. The main scripting language for web is javascripts. The process for client side scripting is

When the user need a web page from the web server

The web server find the page and sends it back to the user

After the page is received it will be displayed in the browser

Client side scripting is mosly used to make changes when the web page arrives to the browser. These scripts are used for interaction and appearance.

The difference between client side ‍‍‍‍‍and server side

the difference between client side and servers side is simple, client side scripting is processed by the client and the server code is processed by the server . client side scripting is seen on the browser when a user requests for a page, however server side scripting is never seen on a browser. Server side scripting is self-sufficient, for example if a web page is created by a web developer it could be seen differently on two different browsers such as internet explorer and firefox.

Client Side advantages

Instantly responds to user's requests

Can improve the usability of web sites depending on user's browser.

Secure, which will prevent it by being re-edited or stolen

Client Side disadvantages

Not every browser supports scripts

Different browser version supports the script differently

Takes time to develope

Server side advantages

Complex processes become more efficient

The user can to add a passwords and usernames

Doesn't need to rely on browsers

Server side disadvantages

Can slow down your web site

E.g. AJAX, accessibility, alerts, confirming choices, prompting the user, redirecting the user, browser detection, creating rollovers, checking/validating input, handling forms, maintaining cookies

Task 3 - P5 (b)

Design interactive scripts using scripting languages (JavaScript) that can be embedded onto the website created in assignment 1.

Select 2 of the following (you may choose your own if you wish) that you must include into a minimum of two web pages:

JavaScript slideshow

Random image generator

Browser version/type detection

Software plug-in detection

Feedback form using JavaScript validation

For each of your chosen scripts produce:

Design:

A flow chart or Pseudo code

Implementation:

Annotated screen shots of the scripts in action on the web pages.

Correct structure of HTML code which includes correct indentation of the code and well commented. M3 (b)

Printouts of the scripts

Testing: P6 (b)

A test table containing the variables being tested, test data, expected results and actual results.

Task 4: D1

Investigate and produce a report (minimum 1 page) that explains at least three examples of how web pages using scripts are implemented differently in two different browsers, for example, Internet Explorer and Firefox.

Browser capability

Each browser supports style sheets differently, this means some features can be ignored as the browser does not supports the particular feature. For this reason some browsers came up with their own proprietary tags. However, most of the new browser versions has a standard compliant than the old versions.

Javascript developers keep up with these new browser versions as they can make their scripts according to how the new browser versions support. There are two ways to tolerate conditions within your script to take different paths depending on capability

These two ways are:

1. Browser detection

2. Object detection

Browser detection

This feature checks the browser carefully, first it searches the browser make and version. Then it chooses which code to run on the user's browser. This is why the same page is different in two browsers.

Browser detection coding

function thisBrowserIs(browserTest){

if(navigator.userAgent.indexOf(browserTest)!=-1){

return true;

}

}

This is the code that allows the browser detection to check the selected browser for its make and version.

Object detection

This feature checks the browser for an aspect of the script. It means that the script can notice whether certain objects can work with the selected browser.

Lady using a tablet
Lady using a tablet

This Essay is

a Student's Work

Lady Using Tablet

This essay has been submitted by a student. This is not an example of the work written by our professional essay writers.

Examples of our work

Object detection example:

if (document.images)

{

do something with the images array

}

Separate style sheets

How to get around internet explorer and Firefox

Firefox and IE supports style sheets differently. However, most web developers make mutiple style sheets for these browsers. After this they customize these style sheets according for the selected browser.

After creating multiple style sheets insert the code below between the harder tags. The IE style sheet will automatically open when the web page is opened in IE. When the web page is opened in other browsers it will automatically open the default style sheet.

<!--[if IE]>

<link rel="stylesheet" type="text/css" href="IE-stylesheet.css" />

<![endif]-->

<![if !IE]>

<link rel="stylesheet" type="text/css" href="default-stylesheet.css" />

<![endif]>

Task 5: D2

Write a report that evaluates the website that you have created stating good points, bad points and discuss at least four different methods that could be used to improve the created web site.

I created a website to a book shop called Harlington book store. It took me 3 weeks to completely finish the website with all the books and prices. As I had previous experience in creating websites this website was quite enjoyable to create. I used three main colours on my website so it would look more professional and creative. I included 9 pages to this website and I have created a menu bar so the user can navigate to these pages. To make this website user friendly I have created alt tags and I have checked the browser capability of the website.

During this period I had many problems creating the website such as I had to upload the books one by one with prices and for each book I had to download the book cover. This took me more than a week to finish all the books. Another problem I faced was when I had to resize all the images of the book to the same size. Uploading the books were the most hated part when creating this website apart from that creating the website was very enjoyable.

One of the things to improve this website would be to create a database so when updating the books can be automatically uploaded on the website instead of uploading on the website itself.

Second could be to make the website mobile friendly, this will allow the users to order books and reserve books online with their mobile phone.

Third would be to resize and compress all the images. This will make the WebPages load quicker than normal. It will also allow the users with dial up connections to use the site without any waiting for the page to load.

Lastly the website can be added with a function which will allow customers to chat online with the store assistance. This will allow the users to ask questions and check stokes.

Checklist for Assignment 2: JavaScript Implementation

Content

Y/N

Comments

TASK 1:

Describe the main features of the chosen

scripting language

(P3)

Explain what a scripting language is and why is it used in the modern web pages

Objects

Events

Methods

Loops

Functions

JavaScript is an object orientated language. Describe what this means.

TASK 2:

(M2)

Explain in detail how scripting languages can be used to improve the functionality of web pages.

TASK 3:

Design, create and test web pages using scripts to implement interactivity. (P5 b) (P6 b) (M3 b)

Script 1:

A flow chart or Pseudo code

Screen shots of the scripts in action on the web page.

Comment and indent your code

Printouts of the scripts

A test table for the script

Script 2:

A flow chart or Pseudo code

Screen shots of the scripts in action on the web page.

Comment and indent your code

Printouts of the scripts

A test table for the script

Task 4:

(D1)

How scripts are implemented differently in two different browsers. (3 Examples)

Task 5:

(D2)

Website Evaluation