-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtest.html
More file actions
27 lines (25 loc) · 827 Bytes
/
test.html
File metadata and controls
27 lines (25 loc) · 827 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>To geometry</title>
</head>
<body>
<textarea id="gcode" name="" cols="30" rows="10"></textarea>
<button id="test">Test</button>
<!-- <script src="browser/gcodetogeometry.js"></script> -->
<script src="browser/gcodetogeometry.min.js"></script>
<script type="text/javascript">
document.getElementById("test").onclick = function() {
var code = document.getElementById("gcode").value;
var result = gcodetogeometry.parse(code);
if(result.errorList.length === 0) {
alert("The GCode is completely parsed.");
} else {
alert("An error or warning is raised.");
}
console.log(result);
};
</script>
</body>
</html>