Within my Django app template, I have some JavaScript code:
bookList = new BookList();
bookList.init();
updateBookUrlList();
However, an error is occurring with the message:
Uncaught TypeError: BookList is not a constructor
The above code is located in an external file named book-list.js:
var BookList=function(){};
BookList.prototype.init=function(){this.$eventslist=$(".event-list"),...
I am struggling to identify what could be causing this issue in my code.
UPDATE:
After modifying my code to:
function BookList() {};
I encountered a new error:
TypeError: bookList.init is not a function