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.
精彩评论