A note on how to convert relative/absolute paths in JavaScript. Use JavaScript like this using document.createElement.
var absolutePath = function(href) {
var link = document.createElement("a");
link.href = href;
return link.href;
}
console.log(absolutePath('hoge')) ;
By doing this, you can convert relative paths to absolute paths.