This is more of a javascript question then a freebase one but hoping someone here can help.<br><br>I am trying to make a call to a webservice in freebase suggest (<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 on that i display the suggestion.<br><br>freebase.suggest.js Line 528.<br><br>p.list_receive = function(input, txt, o) {//fb.log(&quot;list_receive&quot;, input, query, o);<br>
    // handle errors<br>    if (o.status !== &#39;200 OK&#39;) {<br>        fb.error(&quot;list_receive&quot;, o.code, o.messages, o);<br>        return;<br>    }<br>...<br>    var url = &#39;<a href="http://somesite/webservice?callback=mycheckfunction&amp;term=">http://somesite/webservice?callback=mycheckfunction&amp;term=</a>&#39; + suggestKeyWord;<br>
<br>    // Create a script tag, set its src attribute and add it to the document<br>    // This triggers the HTTP request and submits the query<br>        var script = document.createElement(&quot;script&quot;);<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&#39;m using document.createElement(&quot;script&quot; and since that is async i have no idea of knowing the response of my web service.<br>
I could move the further logic into the callback but is there a &#39;synchronous&#39; way to wait until i get a response from my web service.<br>I can&#39;t use xmlHttpRequest because of the cross domain restriction.<br><br>