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

  • Home
  • SEARCH
  • 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 6768493
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:04:53+00:00 2026-05-26T15:04:53+00:00

Hi I am working Android application development using titanium studio.I have developed small application.my

  • 0

Hi I am working Android application development using titanium studio.I have developed small application.my problem is that I can not access variable which is define inside the xhr.on load.I used following code:

xhr.onload = function()
{
var json = this.responseText;
var to_array = JSON.parse(json);
var to_count = to_array.length;
};

I want to access to_count and to_array outside onload function and pass it to another child window.For that I used following code:

var feedWin = Titanium.UI.createWindow({
    url:'home/feed.js'
});//alert(to_count);
feedwin.to_array = to_array;
feedwin.to_count = to_count; 
  • 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-26T15:04:54+00:00Added an answer on May 26, 2026 at 3:04 pm

    The best way to accomplish this is to initialize your feedWin in the onload. So, one of the following two snippets should work:

    xhr.onload = function()
    {
        var json = this.responseText,
            feedWin = Titanium.UI.createWindow({
                url:'home/feed.js'
            });//alert(to_count);
    
        feedWin.to_array = JSON.parse(json);
        feedWinto_count = to_array.length;
    };
    

    or

    var feedWin = Titanium.UI.createWindow({
            url:'home/feed.js'
        });
    
    xhr.onload = function()
    {
        var json = this.responseText,
    
        feedWin.to_array = JSON.parse(json);
        feedWinto_count = to_array.length;
    };
    

    I’m not familiar with Titanium, so I don’t know particulars, but that is my best guess.

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

Sidebar

Related Questions

I'm new to Android development and working on an Android application that requires the
Can anybody please tell me that how closely Android Application Development is associated with
I am working on android geolocation application in that I have added marker for
I'm working on an android application, and I have a drawable that I'm loading
I am working android application my problem is i am using handlers this handler
I am a working on android application development. I am using eclipse IDE. I
I have android application that I need to debug using eclipse. When I right
I am working on an application for android and we since we have lots
Im brand new to Android Application development and I am working on an application
Currently a team of developers is working on Android application and during the development

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.