Reputation: 2664
Im building an html form which shows price for traveling from destination1 to destination2
The trouble is, 'price' is stored in an excel file (which can be changed to almost any format) so is there any way to use javascript to find price from destination1 to destination2?
Im afraid i cant post any code upfront (probably because i have no clue where to start)
Upvotes: 1
Views: 233
Reputation: 2664
As quentin suggested, using a JSON solved my problem
converting csv to JSON was a huge help aswel
Upvotes: 0
Reputation: 28288
Using the new HTML5 File API you can read local files or download the file using an XMLHttpRequest.
I would suggest using the CSV format for reading since it is much easier to parse than Excel files.
Upvotes: 2
Reputation: 3250
Use Html5 File API and maybe it would be great to have at least CSV
Upvotes: 0
Reputation: 1400
If you are ok with only modern browser support (html5), you can use the filesystem api...
http://www.html5rocks.com/en/tutorials/file/dndfiles/
However, older browsers(as far as I know) do not support reading files.
Upvotes: 0
Reputation: 10156
I don't know if it's what u need, but u cant use ActiveXObject to read Excel files.
http://www.codeproject.com/Questions/85672/Read-Excel-values-using-Javascript
Upvotes: 1