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 7412125
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:29:36+00:00 2026-05-29T06:29:36+00:00

for some reason my event data isn’t working correctly with jquery fullcalendar when I

  • 0

for some reason my event data isn’t working correctly with jquery fullcalendar when I load it via ajax. However, the ajax request is definitely returning correctly formatted JSON data – if i simply copy and paste the returned data and hard code it into the event source when initialising the calendar, all works correctly! Here is my code – any idea what the issue could be?

$(document).ready(function() {
    // This is the data returned by the AJAX request - works fine when hard coded
    var data = 
            [{"title":"Test Event","description":"<p>Tester<\/p>","start":"1329264000","end":"1329264000","className":"sport junior_school"}];        

        var cal = $('#calendar').fullCalendar({
            header: {
                left: 'prev,next today',
                center: 'title',
                right: 'month,agendaWeek,agendaDay'
            },
            editable: true,
            eventSources: [
                '<?php echo Url::base()?>school-calendar/fetch_events'
                //data
            ]
        });  
});
  • 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-29T06:29:37+00:00Added an answer on May 29, 2026 at 6:29 am

    In the page you linked from the comment discussion, you are not using the code you showed in your post. In your actual page, you are setting a var named data to the return value of your call to $.getJSON, and then passing data into fullCalendar as an event source.

    var data = $.getJSON('http://staging.jem-digital.com/lathallan/public_html/school-calendar/fetch_events');
    
    $('#calendar').fullCalendar({
        //blah blah...
        eventSources: [
            data
        ],
        //blah blah...
    });
    

    The problem with that is that $.getJSON returns a jQXHR object, and fullCalendar cannot take such an object as a data source.

    In Firebug, if I empty your #calendar element and run the following, I get an event on the calendar:

    $('#calendar').fullCalendar({
      header: {
        left: 'prev,next today',
        center: 'title',
        right: 'month,agendaWeek,agendaDay'
      },
      editable: true,
      eventSources: [
        'http://staging.jem-digital.com/lathallan/public_html/school-calendar/fetch_events'
      ],
      eventRender: function (event, element) {
        element.qtip({
          content: {
            text: formatEvent(event), 
            title: {
              text: event.title,
              button: true
            }
          },
          show: {
            event: 'click', // Show it on click...
            solo: true // ...and hide all other tooltips...
          },
          hide: false,
          style: {
            classes: 'ui-tooltip-light ui-tooltip-shadow ui-tooltip-rounded'
          }
        });
      }
    });
    

    Or, if you really want to run your own AJAX call, then you need to pass data to the calendar in the success callback of the $.getJSON. Here is one variation of such a thing:

    $.getJSON('http://staging.jem-digital.com/lathallan/public_html/school-calendar/fetch_events', function (data) {
        $('#calendar').fullCalendar({
            //blah blah...
            eventSources: [
                data
            ],
            //blah blah...
        });
    });
    

    I see little benefit to the latter, however.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason when I attempt to make a request to an Ajax.net web
Im having a a few javascript gremlins, for some reason my jquery ajax post
For some reason, the event listener I define never seems to receive any events,
For some reason, the following code never calls Event::Event(Event&& e) Event a; Event b;
Ok for some reason I've set up an event trigger for window.loaded in WPF
I use $(window).bind( ... ) to set up event handlers, but for some reason
For whatever reason, my jquery loading overlay doesn't load at all under any circumstance
My list component for some reason is not displaying the data being pulled from
For some reason when I load a page with uploadify, in IE 8 I
I'm trying to fire custom events using jquery but for some reason I can't

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.