Friday, November 29, 2013

Re: JsonpRequestBuilder only works across domains?


Am Dienstag, 26. Januar 2010 18:54:43 UTC+1 schrieb Thomas Broyer:

On Jan 26, 12:43 pm, "m.mil...@newelements.de"
<m.mil...@newelements.de> wrote:
> once again, i have to answer the question myself!
> at first: would anyone PLEASE write an guide for using the
> jsonprequestbuilder!!!! it´s damn annoing the find out everything by
> try and error.
>
> about my problem:
> the name of the callback method for the jsonp request changes whith
> every request.
> when you do the first request the name is: __gwt_jsonp__.I0.onSuccess
> for the second request: __gwt_jsonp__.I1.onSuccess
> for the third: __gwt_jsonp__.I2.onSuccess
> ...
>
> that definetly make sense, BUT is nowhere noted in the
> documentation!!!!!
> and - belive it or not - you can see this little change from one
> request to another very hard when you look at a couple of requests.

The javadoc for JsonpRequestBuilder starts with:
"""The server will receive a request including a callback url
parameter, which should be used to return the response as following:

<callback>(<json>);

where <callback> is the url parameter (see setCallbackParam
(String)),"""

It's clear to me that the URL will contain a query string with a
parameter like "callback=fnName" (where 'callback' is the value you
passed to setCallbackParam, and 'fnName' is the <callback>, i.e. the
function name to "call").
It even comes with an example of calling a GData API (with a link to
the GData API documentation that explains what "?alt=json-in-script"
means)

Maybe you should first read some doc about JSON-P, such as
http://en.wikipedia.org/wiki/JSON#JSONP

@Thomas Broyer

Learn2Read!

--------------------------------------------------------------------------------------------

The javadoc for JsonpRequestBuilder starts with:
"""The server will receive a request including a callback url
parameter, which should be used to return the response as following:

<callback>(<json>);

where <callback> is the url parameter (see setCallbackParam
(String)),"""

--------------------------------------------------------------------------------------------

is here anything written, the callback function name has to start with "__gwt_jsonp__.I0.onSuccess"?!

In facts, the GWT functions "JsonRequestBuilder" and "RequestBuilder" does only work correctly if u'll use callback function names with the GOOGLE names/patterns!

Or in other words, everybody will say this both functions are incredible buggy just google means this is normal and a feature!


This BUG is described on www.inter-net.de (german), inclusive a gwt jsonp solution for all who dont like to use google function names!

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment