Vuoi trasformare qualsiasi dominio inuno specifico?
codice:
var s = "http://localhost/mypage.asp";
s = s.replace(/^([^\/]\/\/)[\w\.]+(\/.+)$/"$1www.myserver.it$2/);
alert (s);
o ti basta sostituire una determinata stringa con un'altra?
codice:
var s = "http://localhost/mypage.asp";
s = s.replace(/localhost/www.myserver.it/);
alert (s);