2
<input type="file" accept=".csv" />
它工作在Chrome,火狐,IE 10,但不工作在Safari。 而我嘗試:
<input type="file" accept="text/csv" />
它只是在Safari上工作。 幫助我跨瀏覽器。 謝謝。
<input type="file" accept=".csv" />
它工作在Chrome,火狐,IE 10,但不工作在Safari。 而我嘗試:
<input type="file" accept="text/csv" />
它只是在Safari上工作。 幫助我跨瀏覽器。 謝謝。
只需使用該逗號)
<input type="file" accept=".csv, text/csv" />
既然你做了兩次,你是否知道接受的是拼寫爲「接受」? – Rob
對不起,我的錯別字。目前,我使用accept =「。csv」,它不適用於Safari。 – WorkWe
截至評論發佈之時,Safari「支持類型格式(例如image/*),但不支持擴展格式(例如.png)」。請參閱[caniuse accept](http://caniuse.com/#feat=input-file-accept)。 – showdev