[thelist] Something wrong with replace (javascript)

.jeff jeff at members.evolt.org
Tue Jul 2 16:56:06 CDT 2002


paulo,

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> From: Amazon Paulo
>
> I'm having trouble with a simple function. In fact,
> "replace" is not working as I thought it was going
> to... It should (?) replace ALL matches in a string,
> but is replacing just the first one.
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

read up on the replace() function.  you're missing the global flag.  without
it it will only replace the first occurrence.

http://developer.netscape.com/docs/manuals/js/client/jsref/string.htm#119425
8

good luck,

.jeff

http://evolt.org/
jeff at members.evolt.org
http://members.evolt.org/jeff/





More information about the thelist mailing list