Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery FullCalendar Event Function Callback is not Rendering My Events
    primarykey
    data
    text
    <p>I'm using the jQuery FullCalendar plug-in for a project I'm working on, and I'm attempting to render events within the calendar that are returned from a request to a Java servlet. The servlet is to return an XML document which I then parse to build an event before pushing it into the necessary array that I then pass to the callback function.</p> <h2>Code</h2> <pre><code>&lt;html&gt; &lt;head&gt; &lt;link rel="stylesheet" type="text/css" href="fullcalendar.css" /&gt; &lt;script type="text/javascript" src="jquery.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="fullcalendar.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document.ready(function() { $("#calendar").fullCalendar({ events: function(start, end, callback) { $.get("servlet?command=getEvents", function(data) { var events = []; $(data).find("event").each(function() { events.push({ id: $(this).find("id").text(), title: $(this).find("title").text(), start: $(this).find("start").text(), end: $(this).find("end").text(), url: $(this).find("url").text() }); } callback(events); }, "xml"); } }); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="calendar"&gt;&lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <h2>XML Returned From Servlet</h2> <pre><code>&lt;xml&gt; &lt;event&gt; &lt;id&gt;Event1&lt;/id&gt; &lt;title&gt;Title1&lt;/title&gt; &lt;start&gt;2011-10-18&lt;/start&gt; &lt;end&gt;2011-10-19&lt;/end&gt; &lt;url&gt;http://www.google.com&lt;/url&gt; &lt;/event&gt; // More Events... &lt;/xml&gt; </code></pre> <p>Now, it seems as though the XML is returned from the servlet as it should be, and the parsing of the data is working properly, too. However, the events themselves are not being rendered into the calendar. I'm not entirely sure what the difference is between <code>events</code> and <code>eventSources</code>, but I've tried both and had neither work properly. Any idea why -- for all intents and purposes -- the plug-in isn't rendering the events that seem to be within the events array as dictated by the documentation? Let me know if you need more details or code; I generated a mock of the necessities above, so it's not my whole code.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload