I'm using this a tutorial from Hackernoon, and I'm getting the error:
jQuery.fn.sortDomElements = (function() { ^ ReferenceError: jQuery is not defined
in the app.js file. I think it is because for some reason the app.js and the index.html file are not linked together. In the index.html file, the js file and jquery script are included. (link to app.js file)
I tried moving up the three script source lines (428-430 index.html) up in the code, to ensure that theyre being included before the page is loaded, but that did not work.
Both the index.html file and the app.js file are the same for me as they are in the example repo.
this is app.js line 8.
// Make a jQuery sort for the chat log based on message timetoken
(tt)
jQuery.fn.sortDomElements = (function() {
return function(comparator) {
return Array.prototype.sort.call(this,
comparator).each(function(i) {
this.parentNode.appendChild(this);
});
};
})();