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

253
Visualizações
error while passing JSON from php to javascript

So I have this php file which have query thats extract data from the DB to draw it on a Chart (Note : I'm using Chart.js lib), btw the chart working fine but in order to pass the value to the chart I have to use json_encode() built-in function to move the array to the javascript side using AJAX to display the array value in the chart but I'm getting this error in the image below:

https://i.stack.imgur.com/B0DZH.png

My PHP code : https://pastebin.com/tNh18qGX

My HTML & JS code : https://pastebin.com/06k9xbe8

Thank you guys.

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

0

Make sure that when you go to you're .php file the only value/text/anything displayed on the page is the json u want to be retrieve by the request.

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