Hi all. I’m trying to avoid AJAX or any other JS library for now since I am just fiddling around and want to get the vanilla basics down. Basically, I record a bunch of temperature data in an SQL database, I use a PHP file to extract this data and turn it into JSON format, and then in a JS file I want to import that JSON and plot it in a Chart.
In my PHP file I have checked the final result and that seems to be correct. I use ” echo json_encode($data); ” (which contains ID’s, Temperature and Humidity values).
Then in the JS file, I start with ” var temps = ” but it returns an “Unexpected token ‘<' " error on this line already.
I also don’t have the name of the PHP file anywhere in the HTML or JS file so I have no clue how they’re supposed to be linked…
It’s probably an easy fix, but I don’t know what I’m doing wrong. Does any one of you have an idea?