Applications Development

Using the John Milton page as a starting point, I figured out the basics of JavaScript, in which I learned how to use a confirm box, which would say whatever I wanted it to say after the user had prompted it by clicking on the first box, which I could also manipulate. The main challenge when I got to the "News or Sports" application was how to get a box that would allow the user to select from a number of different choices while still using text. The solution that I came up with turned out to be sort of a compromise between having the user use only numbers and only text. The prompt box worked best for this as opposed to an alert box or a confirm box, because in an alert box only allows the user to click "Ok" or "Cancel." After establishing the prompt boxes, it was necessary to create a case sensitive statement that would direct the user to the appropriate page. This is where parseInt came in. According to David Flanagan in JavaScript: The Definitive Guide, “[parseInt] convert[s] and return[s] any number at the beginning of a string, ignoring any trailing non-numbers. parseint parses only integers…” (165). After creating a route to each page, I used document.write to establish the links to each of the corresponding BBC pages.

To view my JavaScript pages click here.