2022-08-30 22:12:52 +00:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
2023-08-17 20:30:13 +00:00
|
|
|
<head>
|
|
|
|
<meta name="robots" content="noindex">
|
|
|
|
<title>SheetJS + Dojo Read Demo</title>
|
|
|
|
</head>
|
2022-08-30 22:12:52 +00:00
|
|
|
<body>
|
|
|
|
<h1>SheetJS + Dojo Read Demo</h1>
|
|
|
|
|
|
|
|
(this HTML page is not minified -- feel free to view source!)<br/><br/>
|
|
|
|
<a href="https://docs.sheetjs.com">SheetJS CE Documentation</a><br/><br/>
|
|
|
|
<b>Table output:</b><br/><br/>
|
|
|
|
<div id="tbl"></div>
|
|
|
|
<script>
|
|
|
|
dojoConfig = { packages: [
|
|
|
|
{ name: "xlsx", location: "https://cdn.sheetjs.com/xlsx-latest/package/dist", main: "xlsx.full.min" }
|
|
|
|
] };
|
|
|
|
</script>
|
2023-08-17 20:30:13 +00:00
|
|
|
<script src="dojo.js" data-dojo-config="isDebug:1, async:1"></script>
|
2022-08-30 22:12:52 +00:00
|
|
|
<script>
|
|
|
|
require(["dojo/request/xhr", "xlsx"], function(xhr, _XLSX) {
|
|
|
|
xhr("https://sheetjs.com/pres.numbers", {
|
|
|
|
headers: { "X-Requested-With": null },
|
|
|
|
handleAs: "arraybuffer"
|
|
|
|
}).then(function(ab) {
|
|
|
|
/* read ArrayBuffer */
|
|
|
|
var wb = XLSX.read(ab);
|
|
|
|
/* display first worksheet data */
|
|
|
|
var ws = wb.Sheets[wb.SheetNames[0]];
|
|
|
|
document.getElementById("tbl").innerHTML = XLSX.utils.sheet_to_html(ws);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|