[Developers] RFE: wrap trans/blurb calls in JSON
David Flanagan
david at davidflanagan.com
Tue Jul 22 22:57:52 UTC 2008
Shug Boabby wrote:
> actually... hold that thought, obtaining JSONP through GWT was
> actually quite trivial from the code I was using. All working now...
> somebody please document this! No need for the horrible iframe hack
Not always horrible. You might, for example, actually want to display a
document in an iframe so that it gets an independent set of scrollbars.
For example if the document is just one piece of data displayed in
tabular form...
> anymore, but I would suggest that JSON be supported too :-D
I can't think of any case except client-side JavaScript that would
require a JSON response for the /trans services. And in that case,
JSONP is required.
David
> 2008/7/22 Shug Boabby <shug.boabby at gmail.com>:
>> 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.
>>
>> 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