www.webdeveloper.com
Results 1 to 2 of 2

Thread: [RESOLVED] Problem with Javascript Functions

  1. #1
    Join Date
    Aug 2006
    Location
    Philippines
    Posts
    57

    resolved [RESOLVED] Problem with Javascript Functions

    Hi, this is my first time to post here and i hope someone could help me with my problem.

    I have a function that wraps an XMLHttpRequest call and im planning to return the result of the request call as the result of the container function...

    example:

    Code:
    function getValueFromServer(){
       if(window.XMLHttpRequest) var req = new XMLHttpRequest(); 
       else if(window.ActiveXObject) req = new
       ActiveXObject("Microsoft.XMLHTTP");
    
       httpRequest.open("GET",reqUrl,false);
       httpRequest.onreadystatechange = handleRequest;
       httpRequest.send(null);
    
       function handleRequest(){
          if(req.readyState == 4){
              return req.responseText; // I want this return call to be the return call of the container function getValueFromServer
          }
       }
    }

    any ideas?
    Last edited by Naldz; 08-28-2006 at 12:37 PM.

  2. #2
    Join Date
    Aug 2006
    Location
    Philippines
    Posts
    57
    Solved my own problem...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles