admin管理员组文章数量:1415491
I have HTML canvas which i export into data uri image. Now i want to share this image as easy as possible (without creating FB apps and authentication tokens) on Facebook time line by clicking on custom link on my page.
I have tried something like this:
Image generation:
var dataUrl = context.canvas.toDataURL("image/jpeg");
Sharing link (onClick
):
window.open('.php?u='+encodeURIComponent(dataUrl)+'&t='+encodeURIComponent('Some text'),'sharer','toolbar=0,status=0,width=626,height=436');
When i click the link in Safari I got Safari cannot open page ... (NSPOSIXErrorDomain:100)
How can I easily share data uri image via Facebook sharer URL (or some other way)?
Thanks for answers!
I have HTML canvas which i export into data uri image. Now i want to share this image as easy as possible (without creating FB apps and authentication tokens) on Facebook time line by clicking on custom link on my page.
I have tried something like this:
Image generation:
var dataUrl = context.canvas.toDataURL("image/jpeg");
Sharing link (onClick
):
window.open('http://www.facebook./sharer.php?u='+encodeURIComponent(dataUrl)+'&t='+encodeURIComponent('Some text'),'sharer','toolbar=0,status=0,width=626,height=436');
When i click the link in Safari I got Safari cannot open page ... (NSPOSIXErrorDomain:100)
How can I easily share data uri image via Facebook sharer URL (or some other way)?
Thanks for answers!
Share Improve this question asked Feb 18, 2015 at 10:57 kurochenkokurochenko 1,2543 gold badges19 silver badges44 bronze badges 1- There is no way to share a data url. Either share a real url or upload the image to the users photos – WizKid Commented Feb 18, 2015 at 16:23
1 Answer
Reset to default 4You can decode the DataURI to a share-able URL using this nifty service:
http://aminariana.github.io/data-uri-to-img-url/
This service takes a Base64 encoded DataURI via a POST request, and responds with a URL representing the decoded image. It will wrap your image in a page with opengraph META tags in real time.
本文标签: javascriptShare data uri image on facebookStack Overflow
版权声明:本文标题:javascript - Share data uri image on facebook - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745167750a2645785.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论