Solved

Complex javascript if syntax needed.

Posted on 2008-06-18
2
689 Views
Last Modified: 2012-06-21
I need to write an IF statement that looks at 2 variables X and Y.  This is how it needs to work

if X=53 AND (Y=0 OR Y=2) then do stuff otherwise dont.

In ASP, I can use () to group things together..can I do this with javascript?
0
Comment
Question by:electricd7
2 Comments
 
LVL 49

Accepted Solution

by:
Roonaan earned 500 total points
ID: 21817039
if(X == 53 && ( Y == 0 || Y == 2)) {
  /do stuff
}
0
 

Author Comment

by:electricd7
ID: 21817066
wow...that was quick.  I will test it out, thanks!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now