How to share on Pinterest

I have a JavaScript function for sharing Pinterest as follows:

function shareOnPinterest(url, desc, coverImage){ var str = "http://pinterest.com/pin/create/button/?url=" + encodeURIComponent(url) + "&media=" + coverImage + "&description=" + desc; window.open(str, "_blank"); } 

The url is working fine, but when I click the Pin It button, it is not fixed on the board.

I have a link to this Pinterest JavaScript on my page.

 <script type="text/javascript" src="//assets.pinterest.com/js/pinit.js"></script> 

Is there something I did wrong, or is there another way to share with Pinterest?

Thanks.

+4
source share
1 answer

I'm not sure what you want ... a button for your web page or just to merge images?

These codes work to output images:

 javascript:void((function(){var%20e=document.createElement('script');e.setAttribute('type','text/javascript');e.setAttribute('charset','UTF-8');e.setAttribute('src','http://assets.pinterest.com/js/pinmarklet.js?r='+Math.random()*99999999);document.body.appendChild(e)})()); 
+2
source

All Articles