ソフトウェア
if ( doc.location.href ) {
if ( doc.getElementsByTagName ) {
var base = doc.getElementsByTagName('base');
if ( (base != null ) && ( base.length > 0 ) ) {
url = soutaidotshori( base[0].href, url);
}
else {
if ( url.match(/^\/(.+)/i) ) url = RegExp.$1;
url = soutaidotshori( doc.location.href.match(/^http.+\//i) , url );
}
}
else {
if ( url.match(/^\/(.+)/i) ) url = RegExp.$1;
url = soutaidotshori( doc.location.href.match(/^http.+\//i) , url );
}
}
function soutaidotshori(urlmae,url){
while(url.match(/^\.\.\//) || url.match(/^\.\//)){
if(url.match(/^\.\.\//)){
urlmae.replace(/\/.+?\/$/,"");
url.replace(/^\.\.\//,"");
}
if(url.match(/^\.\//)){
url.replace(/^\.\//,"");
}
}
return [urlmae,url].join('');
}