Thanks for the comments, I finally put together something that works.
My problem was that I could not figure out how the connection to the
data was taking place in all the other examples. Here is my "basic
example":
function showData(id) {
// go get it: ajax call to the doc
var d = loadJSONDoc("/myapp/ajax_test/");
// take file contents and produce something useful
d.addCallback(function (result) {
if (result) {
$(id).innerHTML = "A piece of glorious data: " +
result[0].pk;
} else {
$(id).innerHTML = "But the animal is inside out ... and it
exploded!";
}
});
}
Where 'pk' is the very first field in the result data. Here is what I'm
working with, the django generated json (abbreviated):
[{"pk": "1", "model": "someapp.somemodel", "fields": {"field1": 2}}]
The code above returns "1" for the first value of the data set.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"MochiKit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/mochikit?hl=en
-~----------~----~----~----~------~----~------~--~---