pharaoh fortune slot
Welcome, Guest. Please login or register.
December 12, 2018, 10:36:08 AM

Login with username, password and session length
* Home Help Search Login Register
|-+  General discussions
| |-+  Programming Forum
| | |-+  Please simplify this code!!
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: Please simplify this code!!  (Read 1741 times)
Junior Member

Offline Offline

Posts: 13


View Profile
« on: August 29, 2004, 10:05:26 AM »

Hi there.

I'm trying to grasp JavaScript.  I'm currently studying CIW 1DO-435 & 1DO-437.  I'm understanding the theory, but, I'm a loser when it comes to writing out the code.
The basic syntax is bothering me.

Please explain the parenthese for these examples for me.

Here goes:
this is a confirm() method and a conditional example.

Question 1:
Why do I need to put alert here, if this a confirm() method?

Question 2:
Why are parenthese placed around passWord=="pass" ?
Junior Member

Offline Offline

Posts: 10


View Profile WWW
« Reply #1 on: September 20, 2004, 10:11:10 AM »

1. The alert will display the result of the confirm box, which will be true if you click OK or false if you click Cancel. It is the same as

var a = confirm("Click OK or Cancel.");

2.  The parenthesis aren't really required, but they do delimit the test and make it easier to read.

Hope this helps.


0x2b | ~0x2b : Hamlet
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.13 | SMF © 2006-2011, Simple Machines LLC Valid XHTML 1.0! Valid CSS!