var articles = [
{% for article in article_list %}
{% if not forloop.first %},{% endif %}
{
title: "{{ article.title }}",
slug: "{{ article.slug }}",
content: "{{ article.content }}",
authors: [
{% for author in article.authors.all %}
{% if not forloop.first %},{% endif %}
{
first_name: "{{ author.first_name }}",
last_name: "{{ author.last_name }}",
}
{% endfor %}
]
}
{% endfor %}
]
]
$('#calendar').fullCalendar('addEventSource',articles);
This is code located in calendar-conf-events.js(fullcalendar), and cause error I passing objects to index.html ( which use calendar-conf-events.js ) And, In JS I use objects and template tags, but error
Error is : "identifier or string literal or no numeric literal expected" Cause at {%
.jsfile? If so you cannot use template tags in a.jsfile. You can move your javascript code into an.htmlDjango template and wrap the javascript in<script></script>tags.