0

I am working on a project where I need to extract data from an excel file stored on client side so than i can work on that data. is there any way to do it without using any other Javascript library??

Rahul Das
  • 13
  • 4

1 Answers1

0

you can make a simple ajax call and get the responseText

var request = new XMLHttpRequest();
request.open("GET", "https://jsonplaceholder.typicode.com/", true);
request.onreadystatechange = function ()
{
  if(request.readyState === 4)
  {
    var content = request.responseText;
    document.querySelector('#content').innerHTML = content;
  }
}

request.send();
<div id="content"></div>
Vashnak
  • 352
  • 1
  • 6
  • that's probably because excel uses a format you can't read. Try to save your file in csv, it will work :) – Vashnak Jun 12 '17 at 15:17
  • It did. thank you. So basically there isn't a way to read an excel file in the format which i actually wanted. right?? – Rahul Das Jun 12 '17 at 15:27
  • yeah, without using external library, you won't be able to read .xls files (and I'm not sure a lib exists for that :p) – Vashnak Jun 12 '17 at 15:30