I have been using jQuery lately, but never used JSON with it.
Now, I am preparing JSON using PHP on server-side. I need to fetch that JSON data using javascript (preferred way using jQuery)
I can get JSON data by going to similar URL mentioned below
http://www.example.com/getjson.php?catid=1
OR
http://www.example.com/getjson.php?catid=15
There is a file name "getjson.php" on my server, which will accept a 'get' argument as catid (stands for category id), fetches data from category table, and output data in JSON format.
Now I need JS code (If code would be in jQuery, it would be added advantage as I badly need code in jQuery) which can fetch data from above mentioned URL, and parse it (which I believe is decoding JSON, right?).
One more thing, after fetching data, I need to validate whether data that I have received is in JSON format or not (It's really important)
Category Table have following fields, which I am outputing in JSON format.
ID, Name, Description, ImageURL, Active, Deleted
Please help me out. Thanks.