Thursday, October 9, 2014

Fourteenth Week (September 1-5) Second Encounter with JavaScript!


Hello Mina-san! ^^

This week we learned on the second part of JavaScript the different methods on how to create dialog boxes.

I will introduce first the three different methods.

  • alert( )
  • prompt( )
  • confirm( )
The Alert Box. An alert box is often used to make sure information comes through the user. 
How to make an alert box? I'll teach you! :)
This is an example:
alert("It's Superman!")
It's easy right? You can place this inside the <script></script> tags.

Here is an example of an alert box exercise we did.



This is our first activity. ^^

















This is the second continuation of our second activity. Well sorry I don't have the picture for the first one.







Next lets proceed to the Prompt Box. The Prompt Box is often used if you want the user to input a value before entering the page.

I know this a little confusing but I know you'll know how to use it.
Here is an example:

var name=prompt("What is your name?", "");

Last, is the Confirm Box. A Confirm Box is often used if you want the user to verify or accept something.

If you want to know more info visit this link >> http://www.w3schools.com/js/js_popup.asp

_____________________________________________________

Goodbye! See you next time! God Bless :)


No comments:

Post a Comment