Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

116
Visualizações
Typo3 jQuery OnClick Events

i need some help for my fresh installed Typo3 Website.

I want to set new Values within my DataBase via jQuery onClick Event. So i guess i need to make use of this class: TYPO3\CMS\Core\Database\ConnectionPool. Can someone Guide me how i can make use of this class within JavaScript.

I already tried the following, but i can't get it to work

define(['jquery', 'TYPO3\CMS\Core\Database\ConnectionPool'], function($, conPool) {

   if(conPool.foo == 'bar'){
      conPool.init();
   }
});

Typo3 source

I appreciating any Help. Thanks

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Your frontend should not be allowed to communicate directly with the database of your TYPO3 instance.
If you allow it anyone can inspect your javascript and get credentials to access your database - and do anything they like. :(

The correct way is a server request with the data you want to change.
then some PHP can compute the data (verify, adapt, ...) and change the value in the database (as PHP has the local credentials to access the database). Then it's up to you to give a notice in the front end if that operation was successful or not.
Such a server-request could be a complete page request, but a simple AJAX-call would be enough. Though you does not need to rebuild the complete page. From the Return of that AJAX request you can show only a notice about failure or success as a flash-message or similar.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda