2010/6/15 Aaron Ward edugamer@gmail.com:
As a follow-up to my previous email, I did attempt to access the object through dot notation based on the different layers visible from the link below, but still could not figure out how to access or print anything of value.
testVar is an object, yes, and assuming you're looking for the content of the revision, you need to 1) not try to parse str for JSON, it's already an object 2) add &indexpageids to your API URL and 3) access the text with str.query.pages[testVar.query.pageids[0]].revisions[0]['*'] . This assumes you didn't get an error result or a nonexistent page or whatever: in that case, this code will cause a JS error, so write code that defends against this. You can also examine the structure of the parsed JSON object in Firebug (a Firefox extension for debugging JavaScript), by placing a breakpoint inside myFunc().
Roan Kattouw (Catrope)