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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T21:13:48+00:00 2026-06-10T21:13:48+00:00

Please consider this javascript: $.ajax({ url:’http://ichart.finance.yahoo.com/table.csv?s=GS&a=00&b=1&c=2010&d=08&e=3&f=2012&g=d&ignore=.csv’, type:’get’, dataType:’jsonp’, success:function(data){ alert(data); } }) The URL

  • 0

Please consider this javascript:

$.ajax({
    url:'http://ichart.finance.yahoo.com/table.csv?s=GS&a=00&b=1&c=2010&d=08&e=3&f=2012&g=d&ignore=.csv',
    type:'get',
    dataType:'jsonp',
    success:function(data){
        alert(data);
    }
})

The URL returns a .csv file, but I am specifying the jsonp data type because this is a cross-domain ajax request. Without that parameter I get the “origin is not allowed” error.

Since I specify the jsonp data type, the ajax function throws an error because the .csv file is not JSON format. But in the dev console I can see that the browser DOES receive a coherent .csv file. So I know I am successfully receiving the CSV file. I think it should be possible, but I am not sure how to correctly receive this csv file to my ajax function??

Of course if I could make this URL return a correctly formatted JSON string that would be the best, but I am not sure I can do that.

Here is a fiddle where you can try it, you will have to open up the dev console to see that error: http://jsfiddle.net/92uJ4/3/

Any help is greatly appreciated.

Tim

  • 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-10T21:13:50+00:00Added an answer on June 10, 2026 at 9:13 pm

    Unfortunately, cross-domain restrictions mean that this just isn’t going to work. The system is built specifically so that you can’t pull arbitrary cross-domain content with AJAX. There isn’t any sort of pre-parse method to convert the non-JSONP data you’re getting into actual JSONP data (because that would defeat the point of the restrictions).

    You’re going to have to either make a call to a local server that pulls the data from Yahoo! and sends it to your AJAX request, or find a service of some kind that will pull from an arbitrary URL and return the data as JSONP. As it happens, Yahoo! provides just such a service: YQL (Yahoo query language). See this link for more details.

    To accomplish what you’re wanting, use the code in this fiddle: http://jsfiddle.net/c5TeM/1/

    function get_url(remote_url) {
        $.ajax({
            url: "http://query.yahooapis.com/v1/public/yql?"+
    "q=select%20*%20from%20html%20where%20url%3D%22"+
    encodeURIComponent(remote_url)+
    "%22&format=json",
            type: 'get',
            dataType: 'jsonp',
            success: function(data) {
                alert(data.query.results.body.p);
            },
            error: function(jqXHR, textStatus, errorThrow){
                alert(jqXHR['responseText']);
            }
        })
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Please consider this snippet: http://fruple.com/kemper/test/categorie.html Firefox screenshot: Chrome screenshot why are some of the
please consider this table: PK_Id Number Year Month Value ------------------------------------------------------------------------- 1 1 2000 5
Please consider this code: template<typename T> char (&f(T[1]))[1]; template<typename T> char (&f(...))[2]; int main()
Consider variable like var url='http://www.example.com/index.php?id=ss'; or var url='http://www.example.com/dir1/dir2/index.php'; In these variables, i want to
Please consider this sql statements Create table abc (A int, B int ) insert
Consider the following example code: http://code.google.com/apis/maps/documentation/javascript/examples/streetview-simple.html I can do scrollwheel: false on a mapOptions
please consider this image: I have a table like this: Age Active Men/Women -------------------------------------------------
please consider this code: import xml.etree.ElementTree as ET import urllib XML_response = urllib.urlopen('http://www.navlost.eu/aero/metar/?icao=LWSK&dt0=2011-05-03+12%3A00%3A00&c=1&rt=metar').read() tree
Please consider this code: NSString *jsonreturn = [[NSString alloc] initWithContentsOfURL:[ NSURL URLWithString:url ]]; //
please consider this image: I have a table like this: Age Active Men/Women -------------------------------------------------

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.