Tuesday, 8 December 2009

Exercise 3.9 -- Client side programming

This week, we learned how JavaScript can be used to add interactivity to web pages. JavaScript was developed by Brendan Eich in 1995 as a flexible language that web designers with little programming experience could quickly learn (Krill, 2008). It is primarily used as a client-side programming language executed by the browser, although server-side JavaScript platforms such as ASP also exist.

In the exercise, we used JavaScript to elicit information from users to direct them to an appropriate hyperlink. The WebMonkey tutorial aided me in this exercise, as did the JavaScript lint online validator which allowed me to check my code for errors. I added a while loop so users would be prompted to re-enter information if they entered information which did not match that defined in the variable. I experimented with window.display to redirect users automatically or open hyperlinks in new windows, but felt users would rather decide for themselves if they wanted to visit the hyperlink. My finished programme is available from http://www.student.city.ac.uk/~abgy261/javascript.html .

The exercise gave me confidence in writing simple scripts. At work, I could use JavaScript to direct users to subject-specific resources, or a version of a web page tailored to their Internet Browser. JavaScript has far more sophisticated applications, however. Web technologies such as AJAX use it to bring together technologies such as CSS, XHTML and XML (Open Ajax Alliance, 2009) and power applications such as Google Maps which update in real-time and do not require plug-ins, improving speed and usability. Though JavaScript has existed for fourteen years, it is a potent high-level programming language and I am inclined to agree with Brendan Eich's assertion that in the future, "we'll see even more JavaScript." (Krill, 2009)

No comments:

Post a Comment