I have the following code in a template, using a javascript event calendar:
<script type="text/javascript" src="calendar.js"></script>
<script type="text/javascript">
var myCalendar = new JEC('myCalendar');
myCalendar.showCalendar();
</script>
I am using django to create the site. The calendar shows when I open the html document my browswer, but the calendar does not render when I use the actual site, even though everything else that is included in the template (not shown here) comes up fine. Is there something I am missing here? Do I need to return the myCalendar object to the view in order for it to render properly? I’ve searched a lot for some solutions, but I can’t find anything. Some documentation to point me in the right direction would also be appreciated.
To provide the static content to the user. You need to follow all of these step:-
1) Check in the settings.py static_dir refers to the directory containing your static files
2) Static folder has the read permission
3) From the view code you need to pass content_instance
4) Append {{STATIC_URL}} to the path reference of the js file