Skip to content

Commit 32476f5

Browse files
committed
Use src element and correct relative path for directory return value
1 parent 78bb229 commit 32476f5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/resources/script.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,9 @@ function initSearch(name) {
240240
}
241241

242242
var jsonReq = new XMLHttpRequest();
243-
var scriptUrl = URI(document.getElementById("dartdoc_script_js"));
243+
var scriptUrl = URI(document.getElementById("dartdoc_script_js").src);
244244

245-
jsonReq.open('GET', URI(scriptUrl.directory() + '/../..').absoluteTo(scriptUrl) + '/index.json', true);
245+
jsonReq.open('GET', URI(scriptUrl.directory() + '/..').absoluteTo(scriptUrl) + '/index.json', true);
246246
jsonReq.addEventListener('load', function() {
247247
searchIndex = JSON.parse(jsonReq.responseText);
248248
initTypeahead();

0 commit comments

Comments
 (0)