AW: [Dojo-interest] Re: How to read the response from dojo bind
martin.kluger at tradespark.eu
Tue Jan 2 12:41:05 MST 2007
if you look in dojo/src/BrowserIO.js in the dojo.io.XMLHTTPTransport.doLoad
method you will see the following snippet (current repository):
else if(kwArgs.mimetype == "text/json" || kwArgs.mimetype ==
ret = false;
}else if (
ret = http.responseText;
Returned HTML cannot be converted to a valid js object so the result will
always be false and the server response is lost. Either you extend/modify
the catch statement to return the response anyway (bad idea because you have
to parse in *every* request) or use a text/plain mimetype to
'eval/catch/parse html' yourself if *really* needed (as mentioned by
Do you want to stick with the json mimetype even if you want to parse the
returned html anyway?
> -----Ursprüngliche Nachricht-----
> Von: dojo-interest-bounces at dojotoolkit.org [mailto:dojo-interest-
> bounces at dojotoolkit.org] Im Auftrag von troyf
> Gesendet: Dienstag, 2. Januar 2007 20:09
> An: dojo-interest at dojotoolkit.org
> Betreff: [Dojo-interest] Re: How to read the response from dojo bind
> Diego, Dustin,
> Thanks for the quick replies.
> Diego, yes that was what I was hoping I could do but data just resolves
> false, while in the response tab of Firebug I can see the entire contents
> the html returned from the server.
> Dustin, I think I need to keep the mimetype at text/json since I post json
> to the server and I am expecting (server errors aside) json to be
> Do either of you have more ideas?
More information about the Dojo-interest