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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:39:36+00:00 2026-06-17T09:39:36+00:00

I’m creating a simple stock ticker where the symbols will eventually be entered through

  • 0

I’m creating a simple stock ticker where the symbols will eventually be entered through a cms. So far I’ve been successful in getting the ajax data correctly, I’m trying to figure out how to split each symbol and it’s corresponding data into separate items, list item or whatever. I’ve attempted using .each but without luck.

Here is my js:

(function(){
var getStocks = (function(){

    var initialize = function(){
        _setListeners();
    };

    var _setListeners = function(){

            var symbol = ["GOOG", "AAPL", "A", "AA", "ABT"];

        $.ajax({
            url: "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20csv%20where%20url%3D'http%3A%2F%2Fdownload.finance.yahoo.com%2Fd%2Fquotes.csv%3Fs%3D"+symbol+"%26f%3Dnsl1d1t1c1ohgv%26e%3D.csv'%20and%20columns%3D'name%2Csymbol%2Clast_trade_price%2Cdate%2Ctime%2Cchange%2Ccol1%2Chigh%2Clow%2Ccol2'&format=json",
            dataType: 'json',
        success: function(data) { 
            console.log(data);
            var name = data.query.results.row.name;
            var last_trade = data.query.results.row.last_trade_price;
            var last_trade_size = data.query.results.row.time;
            var change = data.query.results.row.low;

            $.each(data, function(index, value) {
                $("#stock").append('Name:'+name+ 'Symbol:' +symbol+ 'Last Trade:' +last_trade+ 'Last Trade Size:' +last_trade_size+ 'Change:'+change);
            });

    },
        error: function() {
            $("#stock").html('<p>Something has gone terribly wrong.</p>');
        }
    });

};
    //call initialize
    return {init: initialize};
}());
//call headerNav
this.getStocks = getStocks;
}).call(this);
  • 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-17T09:39:37+00:00Added an answer on June 17, 2026 at 9:39 am

    You want to loop over data.query.results.row in your each

    var symbol = ["GOOG", "AAPL", "A", "AA", "ABT"];
    
    $.ajax({
      url: "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20csv%20where%20url%3D'http%3A%2F%2Fdownload.finance.yahoo.com%2Fd%2Fquotes.csv%3Fs%3D" + symbol + "%26f%3Dnsl1d1t1c1ohgv%26e%3D.csv'%20and%20columns%3D'name%2Csymbol%2Clast_trade_price%2Cdate%2Ctime%2Cchange%2Ccol1%2Chigh%2Clow%2Ccol2'&format=json",
      dataType: 'json',
      success: function (data) {
        console.log(data);
    
    
        $.each(data.query.results.row, function (index, item) {
          $("body").append('Name:' + item.name + 'Symbol:' +item. symbol + 'Last Trade:' + item.last_trade_price + 'Last Trade Size:' + item.last_trade_size + 'Change:' + item.change+'<br><br><br>');
        });
    
      },
      error: function () {
        $("#stock").html('<p>Something has gone terribly wrong.</p>');
      }
    });
    

    DEMO: http://jsfiddle.net/2LkLb/

    I would check that data.query.results.row exists first. As I remember YQL will also return an error message if for some reason data isn’t acquired.

    In browser console can inspect the data object, likely a property in it that has something like status. YQL docs will also help

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I have been unable to fix a problem with Java Unicode and encoding. The
I need a function that will clean a strings' special characters. I do NOT
I am trying to loop through a bunch of documents I have to put
I'm making a simple page using Google Maps API 3. My first. One marker
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all

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.