2

Okay, so a friend of mine asked me to help him out with creating a canvas painting application for a mobile site he's working on. However, he was unable to get the "paintings" to save to the server. I did a little checking and it appears that in the current iteration of the browser (based on WebKIt IIRC), .toDataURL support was randomly thrown out. Is there any workaround for this that'll allow the canvas data to be sent via a POST request?

Edit:

Browser- Netfront(R) Browser, NX v.1.0

It simply appears that the browser doesn't support it

canvas = document.getElementById('paint');
var imagedata = canvas.toDataURL();
var datafield = document.getElementById('dataurl');
datafield.value = imagedata;
document.forms["imagedatahold"].submit(); 

On the file that is to receive the data, the querystring is empty. This is not the case in any other browser as far as I can tell.

The value of "imagedata" is returning as:

data:,

4

1 回答 1

6

我曾经遇到过在 Android 设备上运行的网络应用程序的问题。
问题是android没有toDataURL方法实现,所以我最终使用了这个实现:http ://code.google.com/p/todataurl-png-js/ 。
它可能会慢一点,但它可以完成工作。

于 2012-04-19T15:25:28.313 回答