0

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. When 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

santhosh
  • 1,894
  • 3
  • 18
  • 23

1 Answers1

0

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.

cvsguimaraes
  • 12,910
  • 9
  • 49
  • 73
  • XMLHttpRequest cannot load *url*. Origin domain_name is not allowed by Access-Control-Allow-Origin. This is the output i get from the js console – santhosh Sep 13 '11 at 17:43
  • http://stackoverflow.com/questions/3595515/xmlhttprequest-error-origin-null-is-not-allowed-by-access-control-allow-origin – cvsguimaraes Sep 13 '11 at 18:00