0

I am using JQuery UI Full Size Calender ( Mostly Used for Event Management ).

I have a PHP file in which I have prepared a JSON.

Take a look at that JSON File (json-events.php):

echo json_encode(array(

    array(
        'id' => 111,
        'title' => "Event1",
        'start' => "2013-12-12",
        'url' => "http://yahoo.com/"
    ),

    array(
        'id' => 222,
        'title' => "Event2",
        'start' => "2013-12-16",
        'end' => "2013-12-19",
        'url' => "http://yahoo.com/"
    )

));

Now I want to use this data on my Event Calender. Here is the code:

$(document).ready(function() {

        $('#calendar').fullCalendar({

            editable: true,

            events: "json-events.php",

            eventDrop: function(event, delta) {
                alert(event.title + ' was moved ' + delta + ' days\n' +
                    '(should probably update your database)');
            },

            loading: function(bool) {
                if (bool) $('#loading').show();
                else $('#loading').hide();
            }

        });

    });

Somehow it is not showing events. The whole Calender comes empty. No Console error.

1
  • did you parse the json you got from the php script using JSON.parse(php json value); ?? Commented Dec 3, 2013 at 4:21

1 Answer 1

2

You can get values from other page using following :

$.getJSON( json-events.php,  function( data ) {

alert(data.id);
alert(data.title);

});
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.