http://acoderslife.com
-Original Message-
From: Ian Skinner [mailto:[EMAIL PROTECTED]
Sent: Friday, January 18, 2008 12:16 PM
To: CF-Talk
Subject: SOT: JavaScript version of listContains()
Does anybody know if there is a simple, basic JavaScript equivalent of
the CFML listContains
On Jan 18, 2008 9:35 AM, Claude Schneegans [EMAIL PROTECTED] wrote:
that's not to say there's not a simple way tho.
The only other way I can think of is using regExp, but not really simpler.
yeah, i thought about using subStr... but then you'd have to check for
an optional comma in front and
Does anybody know if there is a simple, basic JavaScript equivalent of
the CFML listContains() function that can determine if a given value is
one of four possible values.
TIA
Ian
~|
Adobe® ColdFusion® 8 software 8 is the
Claude Schneegans wrote:
that's not to say there's not a simple way tho.
The only other way I can think of is using regExp, but not really simpler.
Actually after thinking on this a bit it turned out to be fairly
simple. At least for my immediate need of 6 possible 1 character values.
PROTECTED]
Sent: Friday, January 18, 2008 12:16 PM
To: CF-Talk
Subject: SOT: JavaScript version of listContains()
Does anybody know if there is a simple, basic JavaScript equivalent of
the CFML listContains() function that can determine if a given value is
one of four possible values.
TIA
sorry, I responded too quick. This will actually be ListFind and not
ListContains.
On Jan 18, 2008 2:32 PM, Qasim Rasheed [EMAIL PROTECTED] wrote:
I am hoping this will work
function ListContains(list,item,delim){
var del = (delim == null)? ,: delim;
return
I am hoping this will work
function ListContains(list,item,delim){
var del = (delim == null)? ,: delim;
return list.split(del).indexOf(item) != -1;
}
On Jan 18, 2008 12:38 PM, Charlie Griefer [EMAIL PROTECTED] wrote:
On Jan 18, 2008 9:35 AM, Claude Schneegans [EMAIL PROTECTED]
wrote:
PROTECTED]
Sent: Friday, January 18, 2008 12:16 PM
To: CF-Talk
Subject: SOT: JavaScript version of listContains()
Does anybody know if there is a simple, basic JavaScript equivalent of
the CFML listContains() function that can determine if a given value is
one of four possible values.
TIA
Ian
received this transmittal in error; any review,
dissemination, distribution or copying of this transmittal is strictly
prohibited.
-Original Message-
From: Aaron Rouse [mailto:[EMAIL PROTECTED]
Sent: Friday, January 18, 2008 2:42 PM
To: CF-Talk
Subject: Re: JavaScript version of listContains
The guy from leftcorner.com (offline) ported a bunch of CF functions to
JS. I still have a copy. Pretty handy.
Pretty handy indead.
Javascript looks like a retarded language when dealing with strings.
Thanks.
--
___
REUSE CODE! Use custom tags;
See
that's not to say there's not a simple way tho.
The only other way I can think of is using regExp, but not really simpler.
--
___
REUSE CODE! Use custom tags;
See http://www.contentbox.com/claude/customtags/tagstore.cfm
(Please send any spam to this address:
i can't think of a simple, basic way off the top of my head.
i'd probably end up doing a list.split(',') to convert the list to an
array, then looping over the array to see if the element exists.
that's not to say there's not a simple way tho. matter of fact, it's
generally when i've gone ahead
12 matches
Mail list logo