Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] JSON parsing... almost... [SOLVED]



Simon,

Thank you for responding.
Who knows? But if you do console.log(dataObject), you can at least find out
what it's sending you back.

Well, I was about to write back and tell you that console.log(dataObject) outputs nothing, and JSON.parse gives me an error before that anyway...

However, while tinkering with the code in order to provide a clear example of what I mean, I came across the source of my problem.

Turns out, the $.post command is *already* turning the JSON response it gets into a Javascript object before it hands it over to the function you tell it to call.

Which means that when I was calling JSON.parse on it, it was trying to parse an object into an object.

Doh!

So the problem turned out to be that it wasn't JSON.parse that I wasn't understanding, it was the $.post command. It automates things more than I knew.

Thanks for responding inspiring me to go in the right direction.

--
Dave M G


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links