Chromium Code Reviews| Index: net/base/dir_header.html |
| diff --git a/net/base/dir_header.html b/net/base/dir_header.html |
| index 8e885e2a3f7503cd9b491d40c0d9094a41835bf5..550583175de10ec1bc4efe5ab73a3da6482659b2 100644 |
| --- a/net/base/dir_header.html |
| +++ b/net/base/dir_header.html |
| @@ -7,12 +7,16 @@ function addRow(name, url, isdir, size, date_modified) { |
| if (name == ".") |
| return; |
| + var root = "" + document.location; |
|
wtc
2009/09/04 18:08:09
Just curious, why do we need the ""?
Would "paren
eroman
2009/09/04 18:50:33
Instead of document.location, you can use document
|
| + if (root.substr(-1) !== "/") |
| + root += "/"; |
| + |
| var table = document.getElementById("table"); |
| var row = document.createElement("tr"); |
| var file_cell = document.createElement("td"); |
| var link = document.createElement("a"); |
| if (name == "..") { |
| - link.href = document.location + "/.."; |
| + link.href = root + ".."; |
| link.innerText = document.getElementById("parentDirText").innerText; |
| size = ""; |
| date_modified = ""; |
| @@ -23,7 +27,7 @@ function addRow(name, url, isdir, size, date_modified) { |
| size = ""; |
| } |
| link.innerText = name; |
| - link.href = document.location + "/" + url; |
| + link.href = root + url; |
| } |
| file_cell.appendChild(link); |