Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6697487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:27:56+00:00 2026-05-26T06:27:56+00:00

I’m using the jQuery FullCalendar plug-in for a project I’m working on, and I’m

  • 0

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.

Code

<html>
    <head>
        <link rel="stylesheet" type="text/css" href="fullcalendar.css" />
        <script type="text/javascript" src="jquery.min.js"></script>
        <script type="text/javascript" src="fullcalendar.min.js"></script>
        <script type="text/javascript">
            $(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");
                    }
                });
            });
        </script>
    </head>
    <body>
        <div id="calendar"></div>
    </body>
</html>

XML Returned From Servlet

<xml>
    <event>
        <id>Event1</id>
        <title>Title1</title>
        <start>2011-10-18</start>
        <end>2011-10-19</end>
        <url>http://www.google.com</url>
    </event>
    // More Events...
</xml>

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 events and eventSources, 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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T06:27:56+00:00Added an answer on May 26, 2026 at 6:27 am

    I know that I haven’t received any answers yet for this question, but I think I managed to figure out my issue. The <title> tags of the XML file my servlet was returning was sometimes invalid; some of the titles contained invalid XML characters that I needed to replace before shipping the file back to the AJAX call. Once that was done with the following function noted below, all of my events began rendering properly. And yes, I do realize that there is probably a more efficient way to remove invalid characters using regex or something, but everything I tried wasn’t working. This function, though inefficient, works…

    protected static String forXML(String aText) {
        final StringBuilder result = new StringBuilder();
        final StringCharacterIterator iterator = new StringCharacterIterator(aText);
        char character =  iterator.current();
    
        while (character != CharacterIterator.DONE ) {
            if (character == '<') {
                result.append("&lt;");
            }
            else if (character == '>') {
                result.append("&gt;");
            }
            else if (character == '\"') {
                result.append("&quot;");
            }
            else if (character == '\'') {
                result.append("&#039;");
            }
            else if (character == '&') {
                result.append("&amp;");
            }
            else {
                result.append(character);
            }
            character = iterator.next();
        }
        return result.toString();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am reading a book about Javascript and jQuery and using one of the
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a jquery bug and I've been looking for hours now, I can't
I've got a string that has curly quotes in it. I'd like to replace
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.