I’ve been using ajax for a while now and I want to learn more about retrieving data. I only know how to get output by using callbacks.
When I use callbacks and I want individual values, I use split() or explode() so I can get individual value. Is there a better way than this? if I keep using this I think it will get messy if inputs have the same character as the pattern for split/explode.
I want to know how to retrieve data individually via variables, not by echo or HTML outputs.
ask if you don’t understand my problem.
Thanks.
You can return the output from your PHP page as
jSON. you can iterate thru the json results witheachmethod and get items. That is much cleaner way than doingsplitA sample
Assuming you are returning a
JSONresult like the below from your php pageEDIT : When working with Use jSONLint, an awesome webbased tool to tell you whether your JSON is valid or not.
http://jsonlint.com/