Loading ...
Sorry, an error occurred while loading the content.
 

Re: [ydn-javascript] getting connection manager's result

Expand Messages
  • Satyam
    We all would like it to be like that, but it can t be. That s what asynchronous programming is all about, results will come when they please and we have to
    Message 1 of 2 , Dec 28, 2007
      We all would like it to be like that, but it can't be. That's what
      asynchronous programming is all about, results will come when they please
      and we have to provide for that and let the user interface to keep going.
      We cannot let the UI hang on waiting for a reply so we post the request and
      then let the response call back on us.

      Satyam

      ----- Original Message -----
      From: "Ali Deniz EREN" <ali.deniz.eren@...>
      To: <ydn-javascript@yahoogroups.com>
      Sent: Friday, December 28, 2007 1:24 PM
      Subject: [ydn-javascript] getting connection manager's result


      > Hola!..
      >
      > I need something like this;
      >
      > function ascReq(url){
      > var ret = ""
      > var callback = {
      > success : function(o) {
      > if(o.responseText !== undefined){
      > ret += o.responseText;
      > }
      > },
      > failure : function(o) {
      > ret += "CONNECTION FAILED!";
      > }
      > }
      > var conn = YAHOO.util.Connect.asyncRequest('GET', url, callback);
      > return ret;
      > }
      >
      > I want that when i call this function, it returns "ret = o.responseText"
      > back!
      >
      > But when i tried as below,
      >
      > var a = ascReq('../somephpfile.php?foo=bar');
      >
      > i got nothing
      >
      > Whole examples of YUI Ref is based on that get an DIV element and
      > write results of requests into it. I dont want to write them into an
      > HTML element, i want to use them for other process.
      >
      > How can i do?
      >
      > Thanks..
      >
      > --
      > Ali Deniz EREN
      > ali.deniz.eren@...
      >
      >
      >
      > Yahoo! Groups Links
      >
      >
      >
      >
      >
      > --
      > No virus found in this incoming message.
      > Checked by AVG Free Edition.
      > Version: 7.5.516 / Virus Database: 269.17.11/1200 - Release Date:
      > 27/12/2007 13:34
      >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.