我基本上是在创建一个画布应用程序,用户可以在其中看到其他东西的绘图,很像 DrawSomething。
我可以让一个字符串工作,例如:
var points = JSON.parse ('[{"x":10,"y":20,"strokeStyle":"FF0000"},{"x":20,"y":30,"strokeStyle":"FF0000"}]');
但不是当我有倍数时:
var points = JSON.parse ('[{"x":10,"y":20,"strokeStyle":"FF0000"},
{"x":20,"y":30,"strokeStyle":"FF0000"}],[{"x":30,"y":40,"strokeStyle":"00FF00"},
{"x":10,"y":20,"strokeStyle":"FF0000"}],[{"x":50,"y":100,"strokeStyle":"0000FF"},
{"x":70,"y":120,"strokeStyle":"0000FF"}]');
任何帮助,将不胜感激!