views:

84

answers:

2

Title says all, i need to JSON response string / object for debugging purposes. How can i get it ?

+2  A: 

Here you go:

alert(JSON.stringify(object));

That's everything I can give you, as you don't even provide a code example...

Lekensteyn
<script type='text/javascript'> $(document).ready(function() { $('#calendar').fullCalendar({ editable: true, events: "<?php echo $this->baseUrl(); ?>/entities/appointments/list/", 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(); } }); }); </script>
Chris
What's with that? That is not JSON.
Lekensteyn
A: 

for this json:

[
    {                   
        "id": "1",
        "title": "All Day Event ", 
        "allDay": true,
        "start": "1283378679",
        "end": null,
        "url": "#",
        "className": "event-type-one",
        "editable": "true",
        "source": null,
        "description": "Sed enim et mauris purus nisi auctor, amet integer rhoncus, dapibus augue scelerisque."
    }

]

response string would be

$('#calendar').fullCalendar({
      events: "( your path to json )/events.json"
      alert(event.id);
      alert(event.title);
      alert(event.allDay); 
}); 

etc.

orolo