Saturday, 13 September 2014

Week 15 : September 8-12 Learning more in JavaScript

Hi!

     We continued typing and discussing the JavaScript methods.


       Here are the pictures of my work. Yes! I've finished it through hardwork and patience. The alert() method displays an alert box with a specified message and an OK button. An alert box is often used if you want to make sure information comes through to the user.



Note: The alert box takes the focus away from the current window, and forces the browser to read the message. Do not overuse this method, as it prevent the user from accessing other parts of the page until the box is closed.


Question: How do I display a user prompt from JavaScript?
Answer: To display a user prompt dialog, use the JavaScript prompt() method:
Returned Value:
The value returned by prompt depends on what exactly the user does with the dialog. If the user types something and then clicks OK or presses Enter, the prompt method returns the user input string. If the user clicks OK or presses Enter without typing anything into the prompt dialog, the method returns the suggested input, as specified in the second argument passed to prompt. If the user dismisses the dialog (e.g. by clicking Cancel or pressing Esc), then in most browsers the prompt method returns null.

Question: How do I display an OK/Cancel dialog box from JavaScript?
Answer: To display an OK/Cancel box, use the confirm() method:
Returned value:
If the user clicks OK, the confirm method returns true. If the user clicks Cancel, the method returns false.

Signing off.

0 comments:

Post a Comment

// Posted by :Unknown // On :Saturday, 13 September 2014

Hi!

     We continued typing and discussing the JavaScript methods.


       Here are the pictures of my work. Yes! I've finished it through hardwork and patience. The alert() method displays an alert box with a specified message and an OK button. An alert box is often used if you want to make sure information comes through to the user.



Note: The alert box takes the focus away from the current window, and forces the browser to read the message. Do not overuse this method, as it prevent the user from accessing other parts of the page until the box is closed.


Question: How do I display a user prompt from JavaScript?
Answer: To display a user prompt dialog, use the JavaScript prompt() method:
Returned Value:
The value returned by prompt depends on what exactly the user does with the dialog. If the user types something and then clicks OK or presses Enter, the prompt method returns the user input string. If the user clicks OK or presses Enter without typing anything into the prompt dialog, the method returns the suggested input, as specified in the second argument passed to prompt. If the user dismisses the dialog (e.g. by clicking Cancel or pressing Esc), then in most browsers the prompt method returns null.

Question: How do I display an OK/Cancel dialog box from JavaScript?
Answer: To display an OK/Cancel box, use the confirm() method:
Returned value:
If the user clicks OK, the confirm method returns true. If the user clicks Cancel, the method returns false.

Signing off.

Leave a Reply

Subscribe to Posts | Subscribe to Comments

 

Blog Template by YummyLolly.com - Header made with PS brushes by gvalkyrie.deviantart.com
Sponsored by Free Web Space