mikemai58
03-11-2004, 05:09 AM
I need to replace a string in a link as such:
Replace _e in "mypagexyz_e.html" with _f to produce "mypagexyz_f.html".
Note, I do not know the 'mypagexyz' part of the string, ie. it will change and I need one javascript to handle changing the _e to _f without knowing what precedes it in the string. The .html part will be constant. I also don't know if the string already has _e or _f. So, if _f replace with _e or if _e replace with _f.
New to javascript, read about string.replace and others, not sure how to write up the procedure.
Thanks!
-Mike
Replace _e in "mypagexyz_e.html" with _f to produce "mypagexyz_f.html".
Note, I do not know the 'mypagexyz' part of the string, ie. it will change and I need one javascript to handle changing the _e to _f without knowing what precedes it in the string. The .html part will be constant. I also don't know if the string already has _e or _f. So, if _f replace with _e or if _e replace with _f.
New to javascript, read about string.replace and others, not sure how to write up the procedure.
Thanks!
-Mike