save html5 canvas output to my rails app

后端 未结 2 633
一个人的身影
一个人的身影 2021-01-01 06:51

I am trying to save the content of a html5 canvas to my Rails app. I found the

var url = canvas.toDataURL(\'image/png\');

but I cant figur

2条回答
  •  一个人的身影
    2021-01-01 07:22

    simply place the content of url in an hidden field.

    
    

    in javascript (with jquery):

    var url = canvas.toDataURL('image/png');
    $("#canvascontent").val(url);
    

提交回复
热议问题