I have been trying to use jQuery to update the links in a generated Pinterest Profile Widget. The code was generated for my clients website via Pinterest.
This is the code that is embedded:
<a data-pin-do="embedUser" href="http://www.pinterest.com/aliceandlois/" data-pin-scale-width="155" data-pin-scale-height="130" data-pin-board-width="985"></a>
The code it then generates like this:
<a class="PIN_1425163222617_embed_grid_th" title="Pom Pom Wall Hanging — Simple to make and so cute!" data-pin-href="//www.pinterest.com/pin/452963674997848977/repin/x/" data-pin-id="452963674997848977" data-pin-log="embed_user_thumb" style="height: 130px; width: 155px; top: 0px; left: 0px;"><img src="http://media-cache-ak0.pinimg.com/237x/cd/4d/74/cd4d749b360486b0fd4706f1a068c5ce.jpg" data-pin-nopin="true" class="PIN_1425163222617_embed_grid_img" alt="Pom Pom Wall Hanging &#8212; Simple to make and so cute!" style="height: 232.173px; width: 155px; min-height: 232.173px; min-width: 155px; margin-top: -116.086px;"></a>
What I am trying to do is update the URL in "data-pin-href" to remove the "repin/x/" part of the URL, so that it reads for example, //www.pinterest.com/pin/452963674997848977/ instead of //www.pinterest.com/pin/452963674997848977/repin/x/
This needs to be done automatically for every single image in the widget (there are 20).
I have tried using the tutorial posted at How to change the href for a hyperlink using jQuery in order to accomplish this, however, I haven't been able to get it working with the data-pin-href attribute instead of the standard href.
I also found this jSFiddle that I thought might help me, so I modified the code as nessesary but still had no joy: http://jsfiddle.net/TexasBrawler/uQd9h/1/
Can anyone help me with a working solution for this?
Thanks
EDIT: Been doing further research on how to solve this but still no joy. I have referenced the following links in attempts for a solution:
How to set data attributes in HTML elements