Wednesday, December 29, 2010

Tuesday, December 28, 2010

Worked on my website and waiting for my 46" 3d TV

Did some nice work on my website and very happy with what I did hope it's all good for my assignment, then went to buy 3D 46" tv cost a lot but really nice, and now time to go to work.

Monday, December 20, 2010

Some links to my exercises

These are the fruits of my labour. All my hard work over the past 6 weeks. Please, check them out. I am very impressed with myself. Goooo Ish! Why don't you check them out yourself and GIVE ME SOME FEEDBACK people!

Move the mouse over the pictures see what will happen.
move the mouse over to change the person shown.
calculator

XMAS and Snowman
Alert box
try the loop.

Monday, December 13, 2010

Everything going well

Had lots of Java, and HTML and almost half way to finish my charity website,...
but will need to stop now, that is enough for today.

Tuesday, December 7, 2010

Loops
Often when you write code, you want the same block of code to run over and over again in a row.


In JavaScript, there are two different kind of loops:


while - loops through a block of code while a specified condition is true

for - loops through a block of code a specified number of times


The while Loop

The while loop loops through a block of code while a specified condition is true.


Example of while loop:-

<script type="text/javascript">
var i=0;
while (i<=5) { document.write("The number is " + i);
document.write("<br />");
i++;
}

</script>

Explanation:

i is equal to 0.

While i is less than , or equal to, 5, the loop will continue to run.

i will increase by 1 each time the loop runs.

try the loop.

Thursday, December 2, 2010

The If Statement




if statement
use this statement to execute some code only if a specified condition is true


if...else statement
use this statement to execute some code if the condition is true and another code if the condition is false


if...else if....else statement
use this statement to select one of many blocks of code to be executed

switch statement
use this statement to select one of many blocks of code to be executed

Using the If Statement

Try this in your page


<script type="text/javascript">
var d = new Date()
var time = d.getHours()
if (time<10)>Good morning");
}
else if (time>10 && time<16)>Good day");
}
else
{
document.write("Hello World!");
}
</script>


Prompt Box

<html>
<head>
<script type="text/javascript">
function show_prompt()
{
var name=window.prompt("Please enter your name","Harry Potter");
if (name!=null && name!="")
{
document.write("Hello " + name + "! How are you today?");
} }
</script>
</head>
<body>
<input type="button" onclick="show_prompt()" value="Show prompt box" />
</body>
</html>

Check the prompt box on top of the page on the right.