title: How can I populate a calendar with javascript?
body: <p>I'm trying to develop an application where I need to use this calendar : <a href="http://fullcalendar.io/" rel="nofollow">http://fullcalendar.io/</a></p>
  
  <p>The problem is that I can populate it manually, but I can't populate it from my Database.</p>
  
  <p>This is the function that populates the calendar:</p>
  
  <pre><code>$('#calendar').fullCalendar({
         header: {
              left: 'prev,next today',
              center: 'title',
              right: 'month,agendaWeek,agendaDay'
          },
          editable: true,
          eventLimit: true, 
          events:[
              {
                  title: "aaaa",
                  start: "2014-12-12"
              },
              {
                  title: "bbb",
                  start: "2014-12-13"
              }
          ]
  
  
      });
  
  
  
  });
  </code></pre>
  
  <p>and this is the function that allows me to get my data from the Database:</p>
  
  <pre><code>function getEvents(db){
  
          db.transaction(function (tx) {
          tx.executeSql('SELECT * FROM NOTES', [], function (tx, results) {
             // var allEvents = [];
             var allEvents=[]; 
  
              for (var i = 0; i &lt; results.rows.length; i++){
              //var event = {};
              allEvents.push({
                  title: results.rows.item(i).note,
                  start: results.rows.item(i).whenn
  
              });
  
  
              }
  
  
              $.each(allEvents, function(idx, obj){
                  alert(obj.title);
                  });
          }, null);
  
          });
  
  
  
      };
  </code></pre>
  
  <p>When i call the function getEvents(db) in events, it shows me the alerts but doesn't populate the calendar.</p>
  
  <p>PS: I can't use php files.</p>