1

I'm new to csv and am currently trying implement csv external data into my html table and am currently using this guide. http://www.webslesson.info/2017/04/csv-file-to-html-table-using-ajax-jquery.html The code here works in firefox but does not work in chrome. What is the reason for this and how do you fix it?Error Image

yl2201
  • 45
  • 1
  • 8
  • I have Chrome `Version 62.0.3202.94 (Official Build) (64-bit)` here and it works. Which version of Chrome have you tried? find out in options->Help->About – derloopkat Dec 06 '17 at 13:02
  • Version 62.0.3202.94 (Official Build) (64-bit) This works on the demo but doesnt work when i throw it into notepad ++ – yl2201 Dec 06 '17 at 13:07
  • close the csv file and try again – derloopkat Dec 06 '17 at 13:17
  • I've just tried that but still have the same issue.... It works on firefox but not on chrome – yl2201 Dec 06 '17 at 13:28
  • are you getting errors in console? is JS enabled in your browser? – derloopkat Dec 06 '17 at 14:46
  • JS is enabled I've uploaded the error from the console as an image – yl2201 Dec 06 '17 at 16:12
  • I see, you're getting CORS. For some reason Chrome believes the csv file is in a different domain and block the Ajax call for security reasons. Even if the file is in the same folder, Chrome reports CORS error. Deploying both files to localhost solved the problem. – derloopkat Dec 06 '17 at 17:44
  • Possible duplicate of [Allow Google Chrome to use XMLHttpRequest to load a URL from a local file](https://stackoverflow.com/questions/4819060/allow-google-chrome-to-use-xmlhttprequest-to-load-a-url-from-a-local-file) – derloopkat Dec 06 '17 at 17:58

0 Answers0