tags:

views:

139

answers:

4

Hi, I am looking for

if(condion)
{

} 
elseif()
{

}
else
{

}

Is this supported in JQuery. I have seen in some place but cannot get it worked in my SP designer.

Any right directions please? Hari

+8  A: 

Just add a space:

if (...) {

} else if(...) {

} else {

}
Justin Myles Holmes
Much helpful ..
Hari Gillala
+6  A: 

JavaScript's elseif is in the format "else if", e.g.:

if (condition) {

} else if (other_condition) {

} else {

}
Jeff
Thank you.. much helpful
Hari Gillala
When people ask questions like this.. I think it shows a fundamental misunderstanding. With `if` and `else` there really is no need of `elseif`.
Mark
A: 

YES SYNTAX OF else if in jquery is

else if

you need to add space!!! do not forget to add space, jquery is very very strict about it!! ;) lol

Markandey Singh
+1  A: 

There's also a jQuery plugin by Ben Alman that lets you do conditionals inline and chainable, I personally don't like it as too much chaining just mess the code up and makes it less readable. But anyway, here's the link: http://benalman.com/projects/jquery-cond-plugin/

peol
Thanks Peol. They are really cool.
Hari Gillala