Having a peculiar issue with my Django (1.8) app that includes a JavaScript feature. Everything works fine in one section, but I encounter an error in another:
Uncaught TypeError: EventList is not a constructor
The code in the JavaScript file looks like this:
var EventList=function(){};
EventList.prototype.init=function(){this.$eventslist=$(".event-list")
...
When I attempt to call it using eventList = EventList();
, I receive the message:
Uncaught TypeError: EventList is not a function
In the HTML file, within the JavaScript code block:
<script src="{% static 'js/event_list.min.js' %}" type="text/javascript"></script>
<script type="text/javascript">
eventList = new EventList();
eventList.init();
</script>