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 6944633
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:19:56+00:00 2026-05-27T13:19:56+00:00

I have been trying to get a simple xhr request to work but for

  • 0

I have been trying to get a simple xhr request to work but for some unknown reasons nothing happens, not even the onerror function fires off.

        var xhr = Ti.Network.createHTTPClient();
    xhr.onload = function() {
        Titanium.API.log('Success');
    }
    xhr.onerror = function() {
        Titanium.API.log('Error');
    }

    xhr.open("GET","http://www.google.com/");
    xhr.send();

I have tried this with a new created project and still no luck. Using little snitch I noticed that a connection is made by the app to the given url … but still nothing fires off.

What am I missing?

Also I’m developing on an iPhone Simulator.

  • 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-05-27T13:19:56+00:00Added an answer on May 27, 2026 at 1:19 pm

    I don’t think there’s anything wrong with the XHR request – the Titanium.API.log function takes two arguments, but you’re only giving it one, so it’s probably just not printing to the console. The Titanium documentation is down at the moment so I can’t link you to the correct API, but if you change your code to use Ti.API.info, for example, you should see something printed. This works for me:

    var xhr = Ti.Network.createHTTPClient();
    xhr.onload = function() {
        Titanium.API.info('Success');
    }
    xhr.onerror = function() {
        Titanium.API.info('Error');
    }
    
    xhr.open("GET","http://www.google.com/");
    xhr.send();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to get a simple spider to run with scrapy, but
I have been trying to get simple YES/NO radio buttons list working but facing
I have been trying to get more in to TDD. Currently keeping it simple
I have been trying to get nServiceBus to work with Ninject 2.0 as the
I have been trying to get a simple example of the jquery-ui autocomplete to
I have been trying to get a simple networking test program to run with
I have been struggling for days trying to get a simple ActiveX DLL to
I need some help with some CSS coding. I have been trying to get
I have been trying to get this seemingly simple problem fixed for about half
I'm a fairly novice tester, but have been trying to get better at TDD

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.