We have a requirement where we want to read a csv document in Jquery / Javascript.
We are able to read the file from documents (via query) and Static Resource inside the controller and then pass it to javascript.
code snippet - controller
PageReference pr = new PageReference('/resource/1358406667000/ppfBlobTest');
Blob content = pr.getContent();
String[] filecontent = content.toString().split('\n');
blogText = '<script>var st = '+ JSON.serialize(filecontent)+'; </script>';
code snippet - VF Page
<script>
$j = jQuery.noConflict();
$j(document).ready(function() {
alert(st);
});
</script>
But we want to access that file(document) directly from javascript...any solution how to access it?
Have anyone worked on loading a file directly in javascript (VF Page) ??