Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8781225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:14:41+00:00 2026-06-13T20:14:41+00:00

the code my brother wrote worked before but i think i changed him by

  • 0

the code my brother wrote worked before but i think i changed him by mistake maybe you can see why he wont return the XML data.

function CheckFromTo(From,To) 
{
    //alert(From + "," + To);
    var xmlHttp = null;
    var Url = "http://www.fpl.co.il/bo/info/CheckFromTo.aspx?FROM=" + From + "&TO=" + To + "";
xmlHttp = new XMLHttpRequest(); 
    xmlHttp.onreadystatechange = ProcessRequest;
    xmlHttp.open( "GET", Url, true );
    xmlHttp.send(null);
    return (ProcessRequest());


    function ProcessRequest() 
    {
            if ( xmlHttp.readyState == 4 && xmlHttp.status == 200 ) 
            {
                    var response = xmlHttp.responseText;
                    return response;    
            }
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T20:14:43+00:00Added an answer on June 13, 2026 at 8:14 pm

    Look at your XMLHttprequest object

    xmlHttp.open( "GET", Url, true );  <-- the true Boolean
    

    The true boolean in the open method means you are using a asynchronous call, that means you can not return a value. Welcome to asynchronous programming.

    Why does it return undefined?

    What happens in ProcessRequest when the stats is not 200 and the readystate is not 4? Nothing, it returns nothing, hence undefined.

    You need to use a callback function when working with asynchronous calls. That means breaking up your logic into multiple steps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My brother wrote this code for me to show an example of polymorhism. But
Sorry to bother again, but I really need help transforming this Python2 code into
My 15 year old little brother is starting out programming, and he wrote a
I am cleaning up some code in a C# app that I wrote and
Unfortunately, I wrote a lot of code using mysql_query, mysql_fetch_array and mysql_num_rows calls. It's
Does anyone now where i can find some good tutorials / code samples regarding
I am trying to write a program where my brother and I can enter
I wrote the following code when trying to make a doubly-linked list with an
How do you effectively test code that you wrote? I find that it is
I wrote some simple code in C++, and I built it and ran it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.