[Developers] freebase-suggest modification
Zodiac Seven
zodiac.seven at gmail.com
Thu May 15 11:11:32 UTC 2008
Okay, i guess i will make the results var global and access it from the
callback.
Is there a freebase api to get the name of the article in wikipedia?
so if I have the id as "/en/taj_mahal" and the guid as
"#9202a8c04000641f800000000009216a", name as "Taj Mahal"
I guess there must be a way to find out the wikipedia article name which is
http://en.wikipedia.org/wiki/Taj_mahal
On 5/15/08, Dae Park <daepark at metaweb.com> wrote:
>
> I am unaware of any methods invoking something cross domain
> synchronously. Even if it's possible, I doubt you want the browser to
> be "blocked" while you are waiting for your response.
>
>
> -dae
>
>
>
> On May 14, 2008, at 8:25 AM, Zodiac Seven wrote:
>
> > Dae,
> >
> > $.ajax is using a async callback too. Isn't there an approach which
> > will
> > work synchronously like XmlHttpRequest?
> >
> > On 5/14/08, Dae Park <daepark at metaweb.com> wrote:
> >>
> >> You should be able to $.ajax with "jsonp" as the dataType to
> >> accomplish what you want.
> >>
> >> -dae
> >>
> >>
> >>
> >> On May 13, 2008, at 11:09 AM, Zodiac Seven wrote:
> >>
> >>> This is more of a javascript question then a freebase one but
> >>> hoping someone here can help.
> >>>
> >>> I am trying to make a call to a webservice in freebase suggest
> >>> (http://code.google.com/p/freebase-suggest/)
> >>> This means I call a web service for every suggestion and depending
> >>> on that i display the suggestion.
> >>>
> >>> freebase.suggest.js Line 528.
> >>>
> >>> p.list_receive = function(input, txt, o) {//fb.log("list_receive",
> >>> input, query, o);
> >>> // handle errors
> >>> if (o.status !== '200 OK') {
> >>> fb.error("list_receive", o.code, o.messages, o);
> >>> return;
> >>> }
> >>> ...
> >>> var url = 'http://somesite/webservice?
> >>> callback=mycheckfunction&term=' + suggestKeyWord;
> >>>
> >>> // Create a script tag, set its src attribute and add it to the
> >>> document
> >>> // This triggers the HTTP request and submits the query
> >>> var script = document.createElement("script");
> >>> script.src = url;
> >>> document.body.appendChild(script);
> >>> ...
> >>> // further logic to add/remove the item
> >>>
> >>> My problem is that i'm using document.createElement("script" and
> >>> since that is async i have no idea of knowing the response of my
> >>> web service.
> >>> I could move the further logic into the callback but is there a
> >>> 'synchronous' way to wait until i get a response from my web
> >>> service.
> >>> I can't use xmlHttpRequest because of the cross domain restriction.
> >>>
> >>
> >>> _______________________________________________
> >>> 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
>
> _______________________________________________
> Developers mailing list
> Developers at freebase.com
> http://lists.freebase.com/mailman/listinfo/developers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freebase.com/pipermail/developers/attachments/20080515/399f78b6/attachment-0001.htm
More information about the Developers
mailing list