Day 53: Promises and a little help

Dan Esmail - 2/22/2023

Intro

Everything is in place to make the webpage show the graph. That graph has some messed up data but that will be fixed soon enough. There have been more struggles with sending this php data over. Let's talk about it.

What Went Wrong

The main concern I had when I was building out the PHP request the first time was that Ascync that Javascript does was going to call the function too early and I won't have the data in time to have the graph update. Big surprise it didn't update in time and everything was messy. Now I could use a time out function to make this work but, what happens when it's too slow? Well, I have no idea but my good friend chatGPT does.

Fiing the problem

I knew that I was going to need to use promises to make this work. I have no idea how to use promise and I've already torn out all my hair with this project already. I checked chatGPT and it gave me what I needed a simple javascript promise that I could work off. Now I wasn't able to just copy-paste this I had to do a little bit of my own coding to get it to work for me. I now have a working graph. There is a lot more that I want to do. I need to write it all down so I can focus and finish it. The good thing is we are moving forward again.


Day 1

Day 1