I am trying to create a function to strip any occurrence of the string
value of the current location.href from another string.
Here is the basic idea:
var str; //the long string
var reStr; //the new string
x = '/' + location.href + '/g'
re = eval(x);
reStr = str.replace(re, '');