Today we had a lot of progress on the JSON side. We've gotten results working now! They don't display yet, since we're still working on a ListView (via JQueryMobile), but they display in console.
The reason that my JSON wasn't working is because of the fact that it wasn't loading the URL properly. We quickly found a way to fix this - it wasn't using spaces, etc. properly when loading the web page, so we used the method getURIComponent, which basically turns a string into a proper URL.
From there, JSON results were working perfectly, we can now access specific parts of the JSON [Array Books] and then individual properties of those [Book.title].
We made some changes so that it passes a function when XHR loads, so that we're not having issues with null JSON (we weren't able to get it perfectly from the URL after some testing). Hopefully, it'll work perfectly, although it'll still require some major testing.
Parsing text to get it into a format that will match your expectations is a common problem you will encounter throughout your coding journeys. With time you'll spot problems like this almost immediately, since you will be so used to seeing them. Great to see you've found a solution to this one.
ReplyDelete