[Developers] RFE: wrap trans/blurb calls in JSON

Alexander Botero-Lowry alex at foxybanana.com
Tue Jul 22 20:48:51 UTC 2008


> excellent... although it's not quite there. I need to be able to
> obtain proper JSON so that I can  counteract the Same Point of Origin
> restrictions. Perhaps it is possible to do this with JSONP, but I'm
> using GWT and the code I'm using can only handle JSON.
> 
Indeed the intention of JSONP is to counteract the same point of origin
restriction. Since anything in a script tag is eval'd, if it is wrapped
in a function call, you can do something with results from a non-same origin
server. Doing stuff from within gwt, you can simply strip the callback off
and it will be valid JSON that you can use with gwt.

Alex

> 2008/7/22 Nick Thompson <nix at metaweb.com>:
> > trans/raw does actually accept a "callback=" argument that will make
> > it return JSONP (not JSON, but you can chop off the jsonp wrapper).
> >
> > JSONP handling for binary types (e.g. images) may not work, there have
> > been limited use cases for this.  the right thing is probably to base64
> > the binary content, maybe you could construct a data: url with it or
> > something to actually display an image in the browser.
> >
> > Using JSONP for text/* types is well-tested - it's how Mjt applications
> > fetch articles, for example.
> >
> >     nick
> >
> > Shug Boabby wrote:
> >> Hi,
> >>
> >> I have a request... would it be possible to return trans/blurb calls
> >> as JSON, if say a parameter 'json=true' was set? This would be great
> >> as it would allow programmatic access to the blurb instead of having
> >> to use an iframe.
> >>
> >> Note that the documentation on accessing trans/blurb is completely
> >> broken, many of the sentences are just missing words. I suspect this
> >> may be something to do with the use of iframe tags or something in
> >> your markup.
> >> _______________________________________________
> >> Developers mailing list
> >> Developers at freebase.com
> >> http://lists.freebase.com/mailman/listinfo/developers
> > _______________________________________________
> > Developers mailing list
> > Developers at freebase.com
> > http://lists.freebase.com/mailman/listinfo/developers
> >
> _______________________________________________
> Developers mailing list
> Developers at freebase.com
> http://lists.freebase.com/mailman/listinfo/developers
> 


More information about the Developers mailing list