Name: Anonymous 2008-02-07 17:30
Never really got into javascript, found it too hard when i was younger.
Recently I've been asked to make a simple script, i took the task and am finding it impossible seeing as i've been turning up late and stuff.
What I want to do is replace all links on a company blog in this format
1) http://forumnamehere/bbs/thread12345.php
to
2) http://forumnamehere/thread12345.php
i know the answer may be easy but i just can't get the bit with the variable numbers. basically what i'm asking is for a simple bit of javascript which replaces 1 with 2.
I've been trying stuff like this but it doesn't work
s = new String("http://forumnamehere/bbs/thread12345.php");
s = s.replace(/bbs/g,"");
document.write(s);
Recently I've been asked to make a simple script, i took the task and am finding it impossible seeing as i've been turning up late and stuff.
What I want to do is replace all links on a company blog in this format
1) http://forumnamehere/bbs/thread12345.php
to
2) http://forumnamehere/thread12345.php
i know the answer may be easy but i just can't get the bit with the variable numbers. basically what i'm asking is for a simple bit of javascript which replaces 1 with 2.
I've been trying stuff like this but it doesn't work
s = new String("http://forumnamehere/bbs/thread12345.php");
s = s.replace(/bbs/g,"");
document.write(s);