Are there any AJAX examples for the following topics?
1) Make a call to Server and receive JSON array data using by DOJO1.0
2) Make a call to server and send JSON array data using by DOJO1.0?
<SOLVED>***HELP*** DOJO1.0 AJAX example
Submitted by dojo_user28 on Mon, 11/12/2007 - 23:19.
- Login or register to post comments
- Subscribe post

A few things here.
http://dojotoolkit.org/book/dojo-book-0-9/part-3-programmatic-dijit-and-...
Understanding that it can be hard to find something in the book, the beginnings of it are still there; it's a lot of material but probably worth your time, particularly if you're starting out and your thing is widgets.
Also...it's "Dojo", not "DOJO". I'm not entirely sure why some people think that...I could understand if I'd done the logo in all caps but I didn't :) You wouldn't mind explaining why you think its all caps, would you? I'm really kind of curious (and it helps from a marketing standpoint as well).
(Also, it's common practice now to call it "Ajax" as opposed to "AJAX"; I'm not entirely sure when it changed but apparently it has. Go figure.)
Dojo,JSON and Ajax
Regarding "DOJO", "AJAX", sorry it was typo mistake. No idea why I have typed all caps. I will make sure to type "Dojo" , "Ajax". :)
I have already read the document where you are referring . I am new to JSON,Dojo and Ajax. I have little bit difficulty sending and receiving 2 sets of array data from server to client and vice versa using JSON, Dojo and Ajax. If there is an example that explains a little bit more, that will be helpful.
Thanks for your help by the way.
hmm. here's a simple case?
hmm. here's a simple case?
var jsonData = { foo: "value", anotherFoo: "moreValues", subFoo: { foo: "not value above!", bar: "more foolike data" }, beCareful: "noCommaHere!" }; dojo.xhrPost({ url: "foobar.php", content: jsonData, handleAs: "json", handle: function(data,ioArgs){ if(typeof data == "error"){ console.log('error?',data); }else{ // data here is a json array console.dir(data); } } });this actually shows how to both send and receive json data. xhr* functions support a form: param too, which will convert form values into a json array and pass the content of the specific form. you can change your "handleAs" attrib to be text / json / json-comment-filtered and others. hope this helps.
your php would look something like:
"; foreach($_POST as $key => $val){ print "- ".$key." = ".$val."
";
} print "
"; ?>(if you handleAs: is "text", you will see the unordered-list as your data var)
there is a PHP JSON class in dojo/resources/JSON.php - which will take any associative array in PHP and convert to valid JSON. that may help you send valid json data back to the client. depends on which way you want to go, and how much stuff you are doing on the server side.
Thank you... That helps.
Thank you... That helps.