Ok, So I’m using AJAX to pull some information from my MYSQL database and put it onto the screen. The thing is I cannot understand JSON for the life of me. Can you suggest any tutorials or anything that will help?
I mean I get that I can encode my query via JSON but I guess it’s the javascript side I do not understand.
Here’s my quick tutorial:
JSON is a means for expressing data for arrays, objects, and their contents. It has nothing to do with object behaviour (methods).
This class would in JSON would look like:
As you can see, JSON is similar to maps in a lot of languages (key/value pairs). You can also see, that only data is represented. JSON is also shorthand for JavaScript builtins. For example, this previous object can be written in JavaScript like so.
Hope this gives you a little idea of what JSON is about.