Okay, i guess i will make the results var global and access it from the callback.<br><br>Is there a freebase api to get the name of the article in wikipedia?<br>so if I have the id as "/en/taj_mahal" and the guid as "#9202a8c04000641f800000000009216a", name as "Taj Mahal"<br>
I guess there must be a way to find out the wikipedia article name which is <a href="http://en.wikipedia.org/wiki/Taj_mahal">http://en.wikipedia.org/wiki/Taj_mahal</a><br><br><div><span class="gmail_quote">On 5/15/08, <b class="gmail_sendername">Dae Park</b> <<a href="mailto:daepark@metaweb.com">daepark@metaweb.com</a>> wrote:</span><blockquote class="gmail_quote" style="margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; margin-left: 0.80ex; border-left-color: #cccccc; border-left-width: 1px; border-left-style: solid; padding-left: 1ex">
I am unaware of any methods invoking something cross domain<br> synchronously. Even if it's possible, I doubt you want the browser to<br> be "blocked" while you are waiting for your response.<br><br><br> -dae<br>
<br><br><br> On May 14, 2008, at 8:25 AM, Zodiac Seven wrote:<br><br> > Dae,<br> ><br> > $.ajax is using a async callback too. Isn't there an approach which<br> > will<br> > work synchronously like XmlHttpRequest?<br>
><br> > On 5/14/08, Dae Park <<a href="mailto:daepark@metaweb.com">daepark@metaweb.com</a>> wrote:<br> >><br> >> You should be able to $.ajax with "jsonp" as the dataType to<br> >> accomplish what you want.<br>
>><br> >> -dae<br> >><br> >><br> >><br> >> On May 13, 2008, at 11:09 AM, Zodiac Seven wrote:<br> >><br> >>> This is more of a javascript question then a freebase one but<br>
>>> hoping someone here can help.<br> >>><br> >>> I am trying to make a call to a webservice in freebase suggest<br> >>> (<a href="http://code.google.com/p/freebase-suggest/">http://code.google.com/p/freebase-suggest/</a>)<br>
>>> This means I call a web service for every suggestion and depending<br> >>> on that i display the suggestion.<br> >>><br> >>> freebase.suggest.js Line 528.<br> >>><br> >>> p.list_receive = function(input, txt, o) {//fb.log("list_receive",<br>
>>> input, query, o);<br> >>> // handle errors<br> >>> if (o.status !== '200 OK') {<br> >>> fb.error("list_receive", o.code, o.messages, o);<br> >>> return;<br>
>>> }<br> >>> ...<br> >>> var url = '<a href="http://somesite/webservice">http://somesite/webservice</a>?<br> >>> callback=mycheckfunction&term=' + suggestKeyWord;<br> >>><br>
>>> // Create a script tag, set its src attribute and add it to the<br> >>> document<br> >>> // This triggers the HTTP request and submits the query<br> >>> var script = document.createElement("script");<br>
>>> script.src = url;<br> >>> document.body.appendChild(script);<br> >>> ...<br> >>> // further logic to add/remove the item<br> >>><br> >>> My problem is that i'm using document.createElement("script" and<br>
>>> since that is async i have no idea of knowing the response of my<br> >>> web service.<br> >>> I could move the further logic into the callback but is there a<br> >>> 'synchronous' way to wait until i get a response from my web<br>
>>> service.<br> >>> I can't use xmlHttpRequest because of the cross domain restriction.<br> >>><br> >><br> >>> _______________________________________________<br> >>> Developers mailing list<br>
>>> <a href="mailto:Developers@freebase.com">Developers@freebase.com</a><br> >>> <a href="http://lists.freebase.com/mailman/listinfo/developers">http://lists.freebase.com/mailman/listinfo/developers</a><br>
>><br> >> _______________________________________________<br> >> Developers mailing list<br> >> <a href="mailto:Developers@freebase.com">Developers@freebase.com</a><br> >> <a href="http://lists.freebase.com/mailman/listinfo/developers">http://lists.freebase.com/mailman/listinfo/developers</a><br>
>><br> > _______________________________________________<br> > Developers mailing list<br> > <a href="mailto:Developers@freebase.com">Developers@freebase.com</a><br> > <a href="http://lists.freebase.com/mailman/listinfo/developers">http://lists.freebase.com/mailman/listinfo/developers</a><br>
<br> _______________________________________________<br> Developers mailing list<br> <a href="mailto:Developers@freebase.com">Developers@freebase.com</a><br> <a href="http://lists.freebase.com/mailman/listinfo/developers">http://lists.freebase.com/mailman/listinfo/developers</a><br>
</blockquote></div><br>