Reputation: 5939
I have a Javascript <script>
snippet (try here: https://apploitech.github.io/embed-snippets) that executes document.write(...)
, which writes a bunch of html and javascript functions into the DOM.
One of the Javascript functions does this:
document.addEventListener("DOMContentLoaded", function() {
console.log("DOMContentLoaded calling renderJobs");
renderJobs(null, true, 1);
});
It works great for most browsers (Chrome, Safari, Edge 14/15), but on the following browsers, the message Expected ')'
shows up in the IE/Edge Developer Tools console (as shown in screenshot below):
Any thoughts or best methods to debug? I tried going to char 1499
like the error message shows, but there is nothing there related to a )
. Thanks!
Upvotes: 0
Views: 2874
Reputation: 3111
Default parameter is part of ES6/ES2015 spec.
Solution:
function createPaginationButton(pagination_bar, page_num, isAppend) {
if(isAppend === undefined) {
isAppend = true;
}
...
}
This is original function declaration from your snippet unsupported in older browsers:
function createPaginationButton(pagination_bar, page_num, isAppend = true) {
console.log("createPaginationButton(): page_num = " + page_num);
var page_num_box = document.createElement("a");
page_num_box.innerHTML = page_num;
...
...
}
Upvotes: 1