Bring DB data with javascript

1

Hello! I have a MENU and a submenu within each item of this menu.

Every time I click on a menu item, it opens a sub-menu (concert effect). Is there a way to do select within the database and work with the result of these select, within JS?

$(document).ready(function() {
    $('#calendar').fullCalendar({});
});

    $('#addEvent').click(function() {  

      //BUSCAR OS DADOS DO BANCO AQUI, PARA USA-LOS ALI EMBAIXO.
      $('#calendar').fullCalendar(
        'renderEvent',
        {
          title: 'Novo evento', // <-- Inserir os dados aqui
          start: '2016-03-31',  // <-- Inserir os dados aqui também
        }
      );
    });  

Note: I did not find anything, but it's worth mentioning. I'm using laravel , I found nothing, but maybe it has something that helps in this ...
Obs2: It is not mandatory to be javascript , but I do not see how to use php to insert the data in this block.

    
asked by anonymous 08.04.2016 / 22:33

1 answer

1

If you want to use only Java Script, I recommend using Node.js. It is a platform built on the JavaScript engine, you can make a complete application with back end using only Java Script.

Reference: link

    
08.04.2016 / 22:51