开发者

Use jquery to get data from a csv file through http response

开发者 https://www.devze.com 2023-04-04 07:58 出处:网络
I use the jquery get method to get a response from the server. $.get($url, function(data){ alert(data);

I use the jquery get method to get a response from the server.

$.get($url, function(data){
alert(data);
});

The response is a .csv file and I have no clue to get the data. Whe开发者_StackOverflown I use the alert(data), it prints a null value. I use this for a chrome extension. I have added the "permissions": [ "http:///", "https:///" ],

in my manifest.json file. When I use safari browser in my local, it is working properly.

Am I missing something?

Thanks


Is missing something? Just ask it to JavaScript console!

  window.jqxhr = $.get(url, function() {
      console.log('readyState: ' + jqxhr.readyState);
      console.log('statusText: ' + jqxhr.statusText);
      console.log('responseText: ' + jqxhr.responseText);
      console.log('ResponseHeaders: ' + jqxhr.getAllResponseHeaders());
  });

Now go to 'Wrench > Tools > JavaScript console' and see what it say. May it help you to figure out what's happening, if not, post the output here.

0

精彩评论

暂无评论...
验证码 换一张
取 消