Skip to content

Commit 0e63715

Browse files
hoffiew0rm
authored andcommitted
UI: Fix JavaScript error in MSIE due to endswith() usage (prometheus#1172)
* index: avoid endswith() for MSIE compatibility MSIE does not support endswith() [1]. substr() can be used to work around this limitation. [1] https://docs.microsoft.com/en-us/scripting/javascript/reference/endswith-method-string-javascript * index: clean up comment * ui: update bindata
1 parent 6f8ccb0 commit 0e63715

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

ui/app/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
</head>
88
<body>
99
<script>
10-
//If there is no trailing slash at the end of the path in the url,
11-
// add one. This ensures assets like script.js` are loaded properly
12-
if (window.location.pathname.endsWith('/') === false) {
10+
// If there is no trailing slash at the end of the path in the url,
11+
// add one. This ensures assets like script.js are loaded properly
12+
if (window.location.pathname.substr(-1) != '/') {
1313
window.location.pathname = window.location.pathname + '/';
1414
console.log('added slash');
1515
}

ui/bindata.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)