±«Óătv

Scripting

As part of your Controlled Assessment website, you are expected to include scripted elements which aid the interactivity of the package.

A script is a series of commands written in a scripting language that can be executed (carried out) one line at a time.

At this level you are expected to use client side scripting - scripts that will run in the end user's browser.

Scripting languages like are often used to provide enhanced interactivity on websites. These will be scripts in specific pages in your website that will run on the user's browser.

Luckily, you do not have to learn Javascript (though an understanding will help) and you will be able to find numerous scripts on the web that you can use to aid the interactivity of your website.

Links to help your research:

Javascript elements you should consider:

  1. Pop-up windows to display and capture information
  2. Image effects (rollover, zoom, watermark etc)
  3. Image galleries
  4. Calendars
  5. Form validation – checking the date that is input into web forms
  6. Dynamic menus – drop down, pop up or side scrolling menus

Choose your scripted elements wisely!

Consider: does it aid the interactivity of the site? Or does it distract the user and not add any relevant value?

Once you have included your scripted element, it is time to document and explain to the examiner how you implemented the code.

Using a site search script used to enhance interactivity

Below is a simple visual explaination of what is happening during a search. The site search uses two scripts (SearchResult.js, SearchResultData.js). These have been placed in a script folder (called 'js') and called using internal hyperlinks.

When the user enters a search term, the scripts are called and the results displayed on a separate search result page.

A mock up of an implemented search script on Viki's Vinyl website

This can be achieved in Javascript as follows:

</script>
<script src="/js/searchResult.js" type="text/javascript"></script>
<script src="/js/searchResultData.js" type="text/javascript"> </script>
<script src="/js/swc_searchResult_ID832BFA3B05FC4AD1ABCF5C1E6DB55359.js" type="text/javascript"> </script>
<script type="text/javascript">
//<![CDATA[
     function SFGetRef (str)
     {
         return document.all ? document.all[str] : document.getElementById(str);
     }
     function SFSwitchImage(strID, strFileName)
     {
         var obj = SFGetRef(strID);
         if (typeof(obj) + "" == "undefined") return;
         obj.src = strFileName;