Good day,
I have a javascript function which isn't quite working the way I want it.
I want a seperate submit button on a search page, that will allow me to compare the production results with the test environment.
I thought the best way to do so, would be to have a javascript function on the 2nd submit button to edit the URL of document.location to point to production then submit.
So the function looks like:
var url=document.location;
url.replace(/test\./, "");
alert("Am at " + url);
What it is supposed to do is format a URL from this:
<username>.<projectnumber>.<employeename>.db.test.domain.com/restOfURL
to
<username>.<projectnumber>.<employeename>.db.domain.com/restOfURL
But the code is replacing the "restOfURL" part.
I will need the
<username>.<projectnumber>.<employeename>. parts removed as well, but so far I will settle for getting the "test." part removed.
What would be better to use for the replace?