Friday, October 9, 2015

Lab 5

Tenzing Younten
Web Client Programming

Similar to previous labs, this lab also had to do with popups but of a different kind. It was about JavaScript Conditional statements. There are many different statements but this particular statement was about executing different actions based on different conditions. There are four different types of conditional statements which include if, else, else...if and switch statements. They all have different functions. For instance, 'If' is used only when a condition is true and 'else' is used when a condition is not true therefore leading to another condition. And "switch" statement is used to specify many blocks of code to be executed. But for this lab, I only used if and else statements.

I started off by inserting a popup, followed by a question which included "Do you play sports?". Then I put the response by inserting if and else for 'yes' or 'no' reply whichever the user replies. So this would cause the popup to response by presenting whatever I wanted to put for the response of 'yes' or 'no'. As a result of the this lab I learned what JavaScript conditional statements are and how they used in an html document. Also, I can use this skill for my future labs and projects and for my own website as well. This lab is relevant to Web Design as it can be a great help for creating a interactive website.









No comments:

Post a Comment