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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T11:09:16+00:00 2026-06-07T11:09:16+00:00

When reading a CSV file from a server using the jQuery ‘GET’ function I

  • 0

When reading a CSV file from a server using the jQuery ‘GET’ function I do not get any data. When I look at the code using FireBug I can see the GET request is sent and the return value is ‘200 OK’. Also I see that the header is returned correctly so the request is definitely made, and data is returned. This is also what I see in Wireshark. Here I see the complete contents of the CSV file is returned as a standard HTTP response.
But the actual data is not there in my script. Firebug shows an empty response and the ‘success’ function is never called. What could be wrong ?

EDIT: An essential part of information appeared to be missing from my question. The following code runs on my local machine and is started by Aptana Studio in Firefox using the built-in test server.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>       
        <title>New Web Project</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <script src="jquery.js" type="text/javascript" charset="utf-8"></script>

       <script type="text/javascript">
        var csvData;
        $(document).ready(function() {
           $("#btnGET").click(function() {
                csvData = $.ajax({
                    type: "GET",
                    url: "http://www.mywebsite.com/data/sample_file.csv",
                    dataType: "text/csv",
                    success: function () {
                       alert("done!"+ csvData.getAllResponseHeaders())
                     }
                });
           });
        }) 
 </script>
 </head>   

     <body>
        <h1>New Web Project Page</h1>
        <button id="btnGET">GET Data</button>
    </body>
</html>
  • 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-07T11:09:18+00:00Added an answer on June 7, 2026 at 11:09 am

    The code does not work because I try to make a cross-domain GET. The page and script are hosted on my local machine and the GET tries to retrieve data from a totally different domain. Though technically possible it is blocked by all modern browsers because it is a security vulnerability.
    Frederick Behrends pointed me in the right direction. And as he also mentions the only cross domain GET that is allowed is by using “jsonp”.

    Following text was taken from the jQuery documentation:
    “Due to browser security restrictions, most “Ajax” requests are subject to the same origin policy; the request can not successfully retrieve data from a different domain, subdomain, port, or protocol. “

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

Sidebar

Related Questions

I'm reading in from a CSV file, parsing it, and storing the data, pretty
I am reading data from a csv file, and there are date elements in
I am importing data from a CSV file using fgetcsv(), which yields an array
I'm trying to call the LumenWorks .csv file reading library from a C++/CLI application
Im having trouble reading from a CSV file final String DELIMITER = ,; Scanner
I am reading a date value from the CSV file and the value is
I am reading .csv file through PHP using fgetcsv(). Now I am able to
I'm reading a csv file using c# here is a little code snippet. using
I have a System.Data.DataTable which is populated by reading a CSV file which sets
I'm reading in a csv file from a datatable and something is happening. Here's

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.