Define URL for Social Media Pins on Webpage for multiple links
Hi
Can someone please assist me (again) with some JavaScript :o
Below you will see some code of my page, as you will see I link each property section to go to an external page for the full listing of a property.
What I wanted to do is have social media links on each property (which is there and working but improvements to that code is also appreciated lol).
But as you will see I have to define the url multiple times and was wondering is I could just define it once and the social pins automatically pick up the url link for each property.
"updated page with social pins is not live yet" but I have put a test page there so you can see it if you want to view : http://www.silvertreeestates.co.za/test.html
Code:
<!-- 1 Property Listing Start -->
<div class="divborder col-md-8"><br>
<table style="width: 100%">
<tr>
<td style="width: 450px" class="text-left"><a href="https://www.property24.com/for-sale/little-falls/roodepoort/gauteng/736/104867841" target="_blank">
<img src="img/listing/104867841.jpg" width="450" height="253" alt="" class="bw pic tilt"> </a>
</td>
</tr>
<tr>
<td>
<h1>Little Falls</h1>
<h2><span class="exchangesprite zarsprite"></span> R 895,000</h2>
<h2><i class="iconsprite loungesprite"></i> 1<i class="iconsprite bedsprite"></i> 2<i class="iconsprite bathsprite"></i> 1<i class="iconsprite garagesprite"></i> 1<i class="iconsprite carportsprite"></i> 1<i class="iconsprite sizesprite"></i> 73mē
<br><i class="iconsprite taxsprite"></i> R 350pm<i class="iconsprite levysprite"></i> R 700pm
<br><i class="listprite listcarinasprite"></i> <i class="listprite listhelensprite"></i> </h2>
</td></tr>
<tr><td><div class="social"><h4>Share me
<a href="https://www.facebook.com/sharer/sharer.php?u=https://www.property24.com/for-sale/little-falls/roodepoort/gauteng/736/104867841" onclick="window.open('https://www.facebook.com/sharer/sharer.php?u=https://www.property24.com/for-sale/little-falls/roodepoort/gauteng/736/104867841', 'newwindow', 'width=600, height=400'); return false;"><i class="fa fa-facebook-square fa-share style6 grey"></i> </a>
<a href="https://twitter.com/intent/tweet?url=https://www.property24.com/for-sale/little-falls/roodepoort/gauteng/736/104867841" onclick="window.open('https://twitter.com/intent/tweet?url=https://www.property24.com/for-sale/little-falls/roodepoort/gauteng/736/104867841', 'newwindow', 'width=600, height=280'); return false;"><i class="fa fa-twitter-square fa-share style6 grey"></i> </a>
<a href="https://plus.google.com/share?url=https://www.property24.com/for-sale/little-falls/roodepoort/gauteng/736/104867841" onclick="window.open('https://plus.google.com/share?url=https://www.property24.com/for-sale/little-falls/roodepoort/gauteng/736/104867841', 'newwindow', 'width=600, height=600'); return false;"><i class="fa fa-google-plus-square fa-share style6 grey"></i> </a>
<a href="https://pinterest.com/pin/create/button/?url=https://www.property24.com/for-sale/little-falls/roodepoort/gauteng/736/104867841" onclick="window.open('https://pinterest.com/pin/create/button/?url=https://www.property24.com/for-sale/little-falls/roodepoort/gauteng/736/104867841', 'newwindow', 'width=600, height=600'); return false;"><i class="fa fa-pinterest fa-share style6 grey"></i> </a>
</h4></div></tr>
</table></div>
<!-- 1 Property Listing End -->
<!-- 2 Property Listing Start -->
<div class="divborder col-md-8"><br>
<table style="width: 100%">
<tr>
<td style="width: 450px" class="text-left"><a href="https://www.property24.com/for-sale/little-falls-and-ext/roodepoort/gauteng/737/104848547" target="_blank">
<img src="img/listing/104848547.jpg" width="450" height="253" alt="" class="bw pic tilt"> </a>
</td>
</tr>
<tr>
<td>
<h1>Little Falls</h1>
<h2><span class="exchangesprite zarsprite"></span> R 650,000</h2>
<h2><i class="iconsprite loungesprite"></i> 1<i class="iconsprite bedsprite"></i> 2<i class="iconsprite bathsprite"></i> 1<i class="iconsprite carportsprite"></i> 1<i class="iconsprite swimsprite"></i> 1<i class="iconsprite sizesprite"></i> 72mē
<br><i class="iconsprite taxsprite"></i> R 300pm<i class="iconsprite levysprite"></i> R 1,054pm
<br><i class="listprite listhelensprite"></i> </h2>
</td></tr>
<tr><td><div class="social"><h4>Share me
<a href="https://www.facebook.com/sharer/sharer.php?u=https://www.property24.com/for-sale/little-falls-and-ext/roodepoort/gauteng/737/104848547" onclick="window.open('https://www.facebook.com/sharer/sharer.php?u=https://www.property24.com/for-sale/little-falls-and-ext/roodepoort/gauteng/737/104848547', 'newwindow', 'width=600, height=400'); return false;"><i class="fa fa-facebook-square fa-share style6 grey"></i> </a>
<a href="https://twitter.com/intent/tweet?url=https://www.property24.com/for-sale/little-falls-and-ext/roodepoort/gauteng/737/104848547" onclick="window.open('https://twitter.com/intent/tweet?url=https://www.property24.com/for-sale/little-falls-and-ext/roodepoort/gauteng/737/104848547', 'newwindow', 'width=600, height=280'); return false;"><i class="fa fa-twitter-square fa-share style6 grey"></i> </a>
<a href="https://plus.google.com/share?url=https://www.property24.com/for-sale/little-falls-and-ext/roodepoort/gauteng/737/104848547" onclick="window.open('https://plus.google.com/share?url=https://www.property24.com/for-sale/little-falls-and-ext/roodepoort/gauteng/737/104848547', 'newwindow', 'width=600, height=600'); return false;"><i class="fa fa-google-plus-square fa-share style6 grey"></i> </a>
<a href="https://pinterest.com/pin/create/button/?url=https://www.property24.com/for-sale/little-falls-and-ext/roodepoort/gauteng/737/104848547" onclick="window.open('https://pinterest.com/pin/create/button/?url=https://www.property24.com/for-sale/little-falls-and-ext/roodepoort/gauteng/737/104848547', 'newwindow', 'width=600, height=600'); return false;"><i class="fa fa-pinterest fa-share style6 grey"></i> </a>
</h4></div></tr>
</table></div>
<!-- 2 Property Listing End -->
Hope someone can help as per usual... many thanks in advance.
rgds, Simon :cool: