[FX.php List] Javascript question
Fitzgerald, Theodore C
ted-fitzgerald at uiowa.edu
Mon Aug 19 15:54:46 MDT 2013
The pipe character is a special character in regex. You'll probably need to escape it.
This should work:
document.write(str.search("\\|"));
Ted
-----Original Message-----
From: fx.php_list-bounces at mail.iviking.org [mailto:fx.php_list-bounces at mail.iviking.org] On Behalf Of Bob Patin
Sent: Monday, August 19, 2013 4:42 PM
To: FX.php Discussion List
Subject: [FX.php List] Javascript question
OK, Javascript experts, splain this to me:
If I put this:
var str="2014#Steven Patin";
document.write(str.search("#"));
I get 4, which is what I would expect; now, if I put this:
var str="2014|Steven Patin";
document.write(str.search("|"));
I get 0.
Why?
Is a pipe not allowed? I'm trying to concatenate an ID and a name together and them parse them back out in JS, and the 2nd example fails. Stumped as to why...
Thanks,
Bob Patin
Longterm Solutions LLC
bob at longtermsolutions.com
615-333-6858
http://www.longtermsolutions.com
FileMaker 9, 10, 11& 12 Certified Developer Member of FileMaker Business Alliance and FileMaker TechNet
--
Twitter: bobpatin
AIM: longterm1954
iChat: bobpatin
--
Expert FileMaker Consulting
FileMaker Hosting for all versions of FileMaker
_______________________________________________
FX.php_List mailing list
FX.php_List at mail.iviking.org
http://www.iviking.org/mailman/listinfo/fx.php_list
More information about the FX.php_List
mailing list