Friday, November 18, 2016
Lab 3
For lab 3 we had to put into practice the different ways to display date unsing lines of JavaScript code. The easiest alert box is the window.alert box which basically forces the user to read a message before continuing visiting the page. The document.write output focuses on having the user type something in that will often be displayed on the output stream. The console.log displays the expression that you put into the parenthesis only displaying the answer which is often arithmetic . There are so many displays that could be included into your file to make it more proffesinal like. Another one that is very useful for asking questions and actually making the user answer it so they could continue viewing the content on your page is the prompt window. This allows you to control who visits your program more carefully.
Thursday, November 17, 2016
Lab 6
The purpose of lab 6 was to create a JavaScript mouseover, a HTML rollover and lastly a GIF using photoshop cs6. The first thing I did was create tables so it'd look organized and neat and I organized my pictures. Afterwards I created my GIF using photoshop cs6 by creating six layers then placing the pictures one per layer. You have to make sure that the pictures have the jpg extension or else it just won't place the pictures. After that you click on timeline and arrange each ones time. To save it you click save for web and change the source to gif, then I just placed it into my HTML document. To make the HTML rollover you just need a simple one of code which is <a href="URL ADDRESS"><img src="url of first picture" width="400" height="300" onmouseover="this.src='url of second picture'" onmouseout="this.src=url of first picture" /></a>. This lab will be useful for our future projects because it three ways that one can use of like lets say include to your business website so it'd look more attractive and catch the viewers eye.
Lab 2
The purpose of lab #2 was to learn how to properly link a JavaScript document into our html file. The JavaScript file had to contain nothing but the popouts code, which was in a form tag. To do this I created a new file and saved it as lab2.js then introduced the code where I also had written my three goals. Afterwards I went back to the html file and using <script type="text/javascript" src="nameoffile.js"></script> i linked it. I used the form tag to create buttons then i uploaded it.This lab will be useful for future projects because it helps for organization purposes and also because it is a very simple way to demonstrate your ability and knowledge on popouts.
Lab 1
For lab #1 we took into practice the get Element by Id form with a button which basically as shown below when you click on the read more button more description comes out all done by a line of code. This lab will be super useful for future projects because by using this option we would benefit from making good use of the space on our page and also it helps out on your organization. The lab also had to include a description of my information, about how important it was for me to be in the web design academy and also some of the goals I would like to achieve in life. This lab was also an introduction to JavaScript. So we also learned how to link a separate JavaScript file into a HTML file.Thursday, November 10, 2016
JS loop and switch statement
Switch Statement
- The switch statement is used to perform different actions based on a variety of different conditions, to select one of many blocks of code to be executed.
- The way the switch statement works is separated into three parts, first the expression is evaluated, then the value of the expression is compared to the other values and lastly if the computer detects a match then that block gets executed.
- The break keyword breaks out of the switch block. It will stop the execution of more code and case testing inside the block. This will appear once the match is found, and the job is done.
- The default keyword is responsible of specifying the code to run if there is no case match.
Loop Statement:
- Loops are handy whenever you want to run the same code over and over again, with each time executing a different value. Loops can execute a block of code a number of times.
- There are four different kinds of loops. The for loop, the for/in loop, the while loop and the do/while loop.
- The for loop is often the tool you will use when you want to create a loop.
Syntax is
for (statement 1; statement 2; statement3)}
code block to be executed
}
*Where as statement 1 is executed before the loop starts, statement 2 defines the condition for running the loop and statement 3 is executed each time after the loop has been executed.
- The for/in loop are loops through the properties of an object.
- The while loop can execute a block of code as long as a specified condition is true.
Syntax is
while(condition) {
code block to be executed
}
- The do/while loop is a variant of the while loop. It will execute the code of block once, before checking if the condition is true, then it will repeat the loop as long as the condition is true.
do{
code block to be executed
}
while (condition);
Wednesday, November 9, 2016
Friday, November 4, 2016
Lab 5
"Rock, Paper or Scissors"
The goal for Lab #6 was to successfully create a rock, paper and scissors game. In my opinion this was a good thing to do because we not only learn the basics on how to arrange things and make sure they are on the correct place or else there is going to be minor mistakes that will make a difference but also we put our knowledge all together on a game that we have all played since we were little so it's a fun thing to construct. First we used code academy to sort of have an introduction to what it was going to be. After completing all its phases all we had to do was take into our JavaScript document which was linked to the HTML on Dreamweaver. This was also a smart thing to do because we would take what we had learned for cade academy to the final lab and it just works like proving yourself that you are able to do so many things you thought you couldn't . It will also we useful for future projects in case one decides to be a game programmer then we know how the knowledge on how to do a rock paper and scissors game. Tuesday, November 1, 2016
JS if/else statements
Using the if/else statements is probably the best way to create short cuts within a block that gives you different choices. The if statement is to execute a condition that will turn out to be true. You have to make sure you use if in lower case letters, if not the computer will return an error. The else statement is used along the if statement, in case the if statement returns false. The else if statement is to specify a new condition if the first condition is false. And the switch statement is to execute a specify alternative option.
Subscribe to:
Comments (Atom)



