S
SteveB
However, despite being simple, I can't figure it out (maybe because I'm a
newbie).
I'm trying to replace a string with another string, but it simply is not
working (no error messages, just won't work).
Basically, I have a document and I'd like to every occurrence of '&&1&&'
with 'test'. Eventually the user will specify what '&&1&&' will be replaced
with, but for now I can't get this simple test to work. What am I doing
wrong?
Thanks!
<SCRIPT LANGUAGE="JavaScript" type="text/javascript">
<!--
var sDocument = new String("This is a &&1&&.");
alert (sDocument);
sDocument.replace("&&1&&", "test");
// sDocument.replace("&&1&&", txtPrompt.value);
alert (sDocument);
//-->
</SCRIPT>
newbie).
I'm trying to replace a string with another string, but it simply is not
working (no error messages, just won't work).
Basically, I have a document and I'd like to every occurrence of '&&1&&'
with 'test'. Eventually the user will specify what '&&1&&' will be replaced
with, but for now I can't get this simple test to work. What am I doing
wrong?
Thanks!
<SCRIPT LANGUAGE="JavaScript" type="text/javascript">
<!--
var sDocument = new String("This is a &&1&&.");
alert (sDocument);
sDocument.replace("&&1&&", "test");
// sDocument.replace("&&1&&", txtPrompt.value);
alert (sDocument);
//-->
</SCRIPT>