<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>选择和加载本地GGB文件</title>
</head>
<body>
<input type="file" accept=".ggb" onchange="fileSelected(this.files[0])">
<div id="applet"></div>
<script src="../GeoGebra/deployggb.js"></script>
<script>
var applet = new GGBApplet({});
applet.setHTML5Codebase('../GeoGebra/HTML5/5.0/web3d/', true);
window.onload = function() {
applet.inject('applet', 'html5');
};
function fileSelected(file) {
var reader = new FileReader();
if (file) {
reader.readAsDataURL(file);
reader.onload = function(e) {
ggbApplet.setBase64(e.target.result);
};
}
}
</script>
</body>
</html>