Closed Thread
Results 1 to 5 of 5

Thread: XMLHttpRequest does not return anything

  1. #1
    sportsbet35 is offline x10Hosting Member sportsbet35 is an unknown quantity at this point
    Join Date
    Dec 2010
    Posts
    4

    XMLHttpRequest does not return anything

    Hi all,

    I'm new to X10Hosting. I have the following piece of codes that always works for me on other host servers but not here on X10Hosting. Does anybody here know why the codes will only work with "url=http://www.google.com/" but not with some other URLs like www.yahoo.com or www.msn.com? Is there by any chance that X10Hosting happens to block them for some reason?

    Thank you very much.

    P.S.: "GetFile.php" is a very small external program written in cURL that allows cross-domain access.


    Code:
    var XMLHttpRequest;
     
    if (window.XMLHttpRequest)
       HTTPrequest = new XMLHttpRequest();
    else
       try {
          HTTPrequest = new ActiveXObject("MSXML2.XMLHTTP.3.0");   // for older Internet Explorer versions before 7.0
       }
       catch (exception) {
          window.alert("Error: XMLHTTP not supported by current browser.");
          return (-1);
       }
     
    XMLHttpRequest.open("GET","GetFile.php?url=http://www.google.com/");
    XMLHttpRequest.onreadystatechange = function()
    {
       if (XMLHttpRequest.readyState == 4 && XMLHttpRequest.status == 200)
          window.alert("[" +XMLHttpRequest.responseText.substr(0,500) +"]");
     
    }
    XMLHttpRequest.send(null);

  2. #2
    lemon-tree's Avatar
    lemon-tree is offline x10 Minion lemon-tree has a spectacular aura about
    Join Date
    Nov 2007
    Posts
    1,420

    Re: XMLHttpRequest does not return anything

    There are three issues here:
    1. The most significant issue is that GetFile.php doesn't exist on your account, so the request is returning a 404 error every time and then failing

    2. GetFile.php could be counted as a proxy and may cause an account suspension under the relevant clause of the terms of service.

    3. Port 80 is closed on all the free servers, meaning the cURL requests in GetFile.php would be blocked and would error out or return nothing.

  3. #3
    sportsbet35 is offline x10Hosting Member sportsbet35 is an unknown quantity at this point
    Join Date
    Dec 2010
    Posts
    4

    Re: XMLHttpRequest does not return anything

    Hi lemon-tree,

    Just as I suspected: port 80 is being blocked by X10Hosting - thank you very much for being very thorough in answering my question. (sigh ...) This would put me totally out of business since my site depends very much on the data it gets from another site. I'm going to close this thread now and again appreciate your reply.

    ---------- Post added at 08:36 AM ---------- Previous post was at 08:06 AM ----------

    Hi all,

    Does anybody know how to close this thread? I'm looking for the link to close it but I couldn't find it anywhere on the page. If you can close the thread, please close it for me.

    Thank you very much.

  4. #4
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: XMLHttpRequest does not return anything

    Note that the block is only on the free hosts (due to abuse by phishers and other-ne'er-do-wells). If the site is commercial, consider paid hosting, which allows outgoing connections to port 80, as well as being more performant.

    As for closing the thread, an admin will have to do it. (it should show up in "Thread Tools", if anywhere).

  5. #5
    carl6969's Avatar
    carl6969 is offline Community Support Team carl6969 has a brilliant futurecarl6969 has a brilliant futurecarl6969 has a brilliant future
    Join Date
    May 2009
    Location
    Calf Creek TX
    Posts
    6,862

    Re: XMLHttpRequest does not return anything

    Closing thread at request of OP


Closed Thread

Similar Threads

  1. return my script
    By ervan77 in forum Free Hosting
    Replies: 2
    Last Post: 08-23-2010, 06:33 PM
  2. Web Disk Return
    By josh72 in forum Scripts & 3rd Party Apps
    Replies: 9
    Last Post: 04-20-2010, 05:23 AM
  3. Ajax XMLHTTPREQUEST
    By as4s1n in forum Programming Help
    Replies: 5
    Last Post: 03-22-2010, 12:30 PM
  4. My return to x10!!
    By Zenax in forum Introductions
    Replies: 6
    Last Post: 02-14-2009, 04:34 PM
  5. Making AJAX return a value.
    By sonicsshadow in forum Programming Help
    Replies: 5
    Last Post: 06-15-2008, 04:07 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers