Hehe. I guess i missed that. I read through these pretty quickly...
On Thu, Jul 30, 2009 at 2:35 PM, Alex McAuley < [email protected]> wrote: > the original post is signed with my name !! > Alex Mcauley > http://www.thevacancymarket.com > > ----- Original Message ----- > *From:* Rick Waldron <[email protected]> > *To:* [email protected] > *Sent:* Thursday, July 30, 2009 7:31 PM > *Subject:* [Proto-Scripty] Re: ternary operators > > Huh? > > Jeztah == Alex? > > On Thu, Jul 30, 2009 at 8:37 AM, Alex McAuley < > [email protected]> wrote: > >> Sorry you missed the point i was trying to achieve. >> >> I wanted the operator to in essence evaluate 2 responses for example. >> >> alert('Element Does not exist'); alert('The second responsee'); >> >> However it cannot be achieved so it must be done usung if/else.. >> >> Regards >> >> Alex Mcauley >> http://www.thevacancymarket.com >> >> ----- Original Message ----- >> *From:* Rick Waldron <[email protected]> >> *To:* [email protected] >> *Sent:* Thursday, July 30, 2009 1:18 PM >> *Subject:* [Proto-Scripty] Re: ternary operators >> >> >> Drop the parens around the first argument. >> >> function foo(arg) { >> >> return $(arg) ? true : alert('Element Does not exist'); // i commented >> this out: false; >> >> } >> ....... >> >> >> >> On Tue, Jul 28, 2009 at 12:02 PM, Alex McAuley < >> [email protected]> wrote: >> >>> >>> In my usual "Not enough coffee" moments i just used an If/Else instead >>> lol >>> >>> Not sure why i was trying to cut code using a tenary ... >>> >>> We live and learn >>> >>> Sorry for useless post >>> >>> >>> Alex Mcauley >>> http://www.thevacancymarket.com >>> >>> >>> ----- Original Message ----- >>> From: "Jeztah" <[email protected]> >>> To: "Prototype & script.aculo.us" < >>> [email protected]> >>> Sent: Tuesday, July 28, 2009 4:51 PM >>> Subject: [Proto-Scripty] ternary operators >>> >>> >>> > >>> > 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~----------~----~----~----~------~----~------~--~---
