我有从 textarea 返回的以下字符串变量:jtext = $('#putJS').val();
该字符串的结果如下:
ctx.beginPath();
ctx.moveTo(172 + xoff, 29 + yoff);
ctx.bezierCurveTo(183 + xoff, 33 + yoff, 199 + xoff, 36 + yoff, 201 + xoff, 74 + yoff);
ctx.bezierCurveTo(191 + xoff, 91 + yoff, 197 + xoff, 130 + yoff, 196 + xoff, 110 + yoff);
ctx.bezierCurveTo(195 + xoff, 95 + yoff, 200 + xoff, 230 + yoff, 200 + xoff, 248 + yoff);
ctx.bezierCurveTo(200 + xoff, 256 + yoff, 85 + xoff, 251 + yoff, 70 + xoff, 251 + yoff);
ctx.bezierCurveTo(65 + xoff, 251 + yoff, 74 + xoff, 122 + yoff, 71 + xoff, 106 + yoff);
ctx.bezierCurveTo(68 + xoff, 88 + yoff, 65 + xoff, 87 + yoff, 65 + xoff, 73 + yoff);
ctx.bezierCurveTo(65 + xoff, 52 + yoff, 70 + xoff, 35 + yoff, 95 + xoff, 28 + yoff);
ctx.bezierCurveTo(99 + xoff, 37 + yoff, 130 + xoff, 72 + yoff, 171 + xoff, 29 + yoff);
ctx.stroke();
问题是,如何将此字符串作为 javascript 代码来设计我的代码 javascript 文件中的画布?