First I installed two pictures in a p: the picture in base64 format and the local picture obtained by input type=file
Then use html2canvas to synthesize a canvas
Finally, in order to facilitate the long press to save the image on the phone, I want to convert the canvas synthesized by html2canvas into base64 using toDataUrl and then display it with the img tag.
But! Here comes the problem. I reported this error in Safari, and it cannot be converted to base64 on the phone.
All my pictures are in base64 format, and they are not cross-domain. There is no problem in Chrome . Does anyone know what happened? Please give me the ending
canvas = document.querySelector("#canvas")??
下面是我最近写的一个合成功能的页面,在各设备上都能很好运行,希望能帮到你。
http://lonelymoon.linux2.jiuh...
或者你给出个项目链接,需要看看实际效果和代码,才能给出办法,不然只能靠猜,你试试在控制台输入document.createElement("canvas").toDataURL() 看看能不能运行,如果能运行就代表接口没问题,是代码内部的问题。