问题
<html>
<body>
<script src="processing.js"></script>
<script type="text/processing" data-processing-target="mycanvas">
Table table;
void setup() {
table = new Table();
table.addColumn("name");
table.addColumn("type");
TableRow newRow = table.addRow();
newRow.setString("name", "Lion");
newRow.setString("type", "Mammal");
newRow = table.addRow();
newRow.setString("name", "Snake");
newRow.setString("type", "Reptile");
newRow = table.addRow();
newRow.setString("name", "Mosquito");
newRow.setString("type", "Insect");
println(table.getStringColumn("name"));
}
</script>
<canvas id="mycanvas"></canvas>
</body>
</html>
Why is this code not displaying in Firefox? It should print all values in the column "name". This example is directly from the processing.js website.
回答1:
Processing.js has no implementation of the newer Processing Table class, so it won't be doing very much unless you supply your own Processing implementation of the Table class (as additional file to load, for instance).
The currently supported API can be found on http://processingjs.org/reference/
来源:https://stackoverflow.com/questions/29018055/why-is-this-processing-js-code-not-displaying-in-firefox