F
Flintstone
I am trying to replace particular words in a string with a sequence of
dollar signs (necessary for a JS FTP app which is part of a larger
project).
The following code should replace test_dollar_test with test_$$$$$
$_test but it only replaces with test_$$$_test. Sure, I can just use \$
\$\$\$\$\$\$\$\$\$\$\$ but then if this is a bug and they fix it my
app will not work. Does anybody know why this happens? Any workarounds
are welcome.
<html>
<head>
<title>test</title>
<script language="javascript">
var str = 'test_dollar_test';
str = str.replace(/dollar/g, "\$\$\$\$\$\$");
alert(str);
</script>
</head>
<body>
</body>
</html>
dollar signs (necessary for a JS FTP app which is part of a larger
project).
The following code should replace test_dollar_test with test_$$$$$
$_test but it only replaces with test_$$$_test. Sure, I can just use \$
\$\$\$\$\$\$\$\$\$\$\$ but then if this is a bug and they fix it my
app will not work. Does anybody know why this happens? Any workarounds
are welcome.
<html>
<head>
<title>test</title>
<script language="javascript">
var str = 'test_dollar_test';
str = str.replace(/dollar/g, "\$\$\$\$\$\$");
alert(str);
</script>
</head>
<body>
</body>
</html>