Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

254
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!