kbdkn
09-16-2008, 06:55 PM
Hi - the replace function doesn't care for the leading ? in bold below. Using \ as an escape doesn't help - is there a different escape character, or a way around this? (3.1.0-RC1, Vista Business.)
var str1 = "?careId=";
var str2 = replace(str1,"careId=", "&careId=");
Alert(str2);
var str3 = replace(str2,"?&careId=", "?careId=");
Alert(str3);
Thanks
-Kim
Error message:
Couldn't execute this script! Error on position (6:0) :
Function call replace is not valid : Dangling meta character '?' near index 0
?&careId=
^ (script#6)
var str1 = "?careId=";
var str2 = replace(str1,"careId=", "&careId=");
Alert(str2);
var str3 = replace(str2,"?&careId=", "?careId=");
Alert(str3);
Thanks
-Kim
Error message:
Couldn't execute this script! Error on position (6:0) :
Function call replace is not valid : Dangling meta character '?' near index 0
?&careId=
^ (script#6)