Afternoon guys....

Is it possible in javascript to give out 2 answers to a tenary
opertor.... (doesnt make sense i know - see below)

function foo(arg) {

return ($(arg)) ? true : alert('Element Does not exist');false;

}
...........
(wrapped in window loaded function)

foo('bazzzzzzzzzzzzz'); // doesnt exist so i want it to alert the
alert and return false to halt the script.......


<div id="bar"></div>



Is this the right way to do it in the operator or cant it be done....
and no i dont want to make 2 functions i would like it in one if it
can be done.

Regards
Alex Mcauley

http://www.thevacancymarket.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to