Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Save the canvas on facebook share click
- $('.button').on('click', function(e) {
- // e.preventDefault();
- // console.log(canvas);
- var dataURL = canvas.toDataURL();
- // window.open(canvas.toDataURL('image/png'), '_blank');
- $.ajax({
- type: "POST",
- url: "save.php",
- data: {
- imgBase64: dataURL,
- imageUrl: hash
- }
- }).done(function(o) {
- console.log('saved');
- // If you want the file to be visible in the browser
- // - please modify the callback in javascript. All you
- // need is to return the url to the file, you just saved
- // and than put the image in your browser.
- // Redirect to trailer page after share
- // Has to be placed inside of done function otherwise image occasionaly doesn't render for mobile in time
- window.location.href = "/";
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement