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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T07:07:18+00:00 2026-06-11T07:07:18+00:00

Hello there am trying to save news tweets into three different array which are

  • 0

Hello there am trying to save news tweets into three different array which are dynamically created.

am finding trouble when i want to get the text from each one of those array and make another request to twitter.

    news_tweets("reuters","1652541",3);
    function news_tweets(query, user_id,count) {
        news_array = [];
        $.getJSON("https://api.twitter.com/1/statuses/user_timeline.json?include_entities=true&include_rts=false&user_id=" + user_id + "&count="+count+
        "&callback=?",
        function (data) {
      for (var i = 0; i < count; i++) {
          var user = data[i].user.name;
          var date = data[i].created_at;
          var profile_img = data[i].user.profile_image_url;
          var text = data[i].text;
          var url = (data[i].entities.urls.length > 0 ? data[i].entities.urls[0].url : '');
          news_array[i] = [{user:user,date:date,profile_img:profile_img,text:text,url:url}];
        }  
      for (var i = 0; i < news_array.length; i++) {
          for (var x=0; x<i.length; x++){
              console.log(news_array[i][x].user);
              }
            }
        });
    }

It doesn’t show anything on the console.log.

thanks for the help!!!!!

  • 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-11T07:07:20+00:00Added an answer on June 11, 2026 at 7:07 am

    First, make sure that your count is smaller than the data array’s length, otherwise this could lead to some undefined values:

    for (var i = 0; i < count && i < data.length; i++) …
    

    Then, why are you creating all those one-element-arrays in the news_array? Just use only objects.

    This would solve your actual issue: You are looping wrong over those inner arrays. The correct code would be

    for (var i = 0; i < news_array.length; i++) {
        for (var x = 0; x < news_array[i].length; x++){
            console.log(news_array[i][x].user);
        }
    }
    

    Also, you should indent your code properly. You have some odd braces around, which don’t make the code readable.

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

Sidebar

Related Questions

Hello there im trying to save some data from dynamic textboxes into XML file.
I want to include Core Location and I'm trying to follow this tutorial: http://www.mobileorchard.com/hello-there-a-corelocation-tutorial/
Hello I´m trying to automate AZURE VM management like Amazon EC2. Is there any
Hello there I am trying to add a Library to an Android application. I
Hello there i'm trying to create a form with Zend_Form that will enable my
Hello there i'm trying to write a layout similar to the timepicker widget layout.
Consider the below code to save data in array, arr[]['name'] = 'hello'; arr[]['value'] =
Hello There, I am new to phonegap.I am trying to record a audio clip
Hello there im trying to send files using client-server classes in java. For some
hello there :) Im trying to figure out how i can grab some content

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.