Why is this processing.js code not displaying in firefox?

时光怂恿深爱的人放手 提交于 2019-12-13 07:44:08

问题


<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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!