Title and URL in a Hyperlink for Digg and the likes

Status
Not open for further replies.

Simona

New Member
Hi guys,

I would love to have the small logos of Digg, Reddit, del.icio.us etc. on every page of our website with articles. As there are many of these pages, is there a way to do it automatically? Something like:

<a href="http://digg.com/remote-submit?phase=2&amp;url=' + document.url + '&amp;title=' + document.title + '" target="_blank">Digg</a>"

I am not into web design at all so if you could put a link together for me... And let me know if I can then help you - as a reward - with some marketing advice.

Thanks a million!

Simona, 3r.ie
 

Simona

New Member
Thank you, Cormac, looks interesting, it will really make the whole thing much easier, however, I still would prefer some automatic code that would embed the title and the url of the current page in the link...

Thanks again.

Simona
 

Forbairt

Teaching / Designing / Developing
You're probably after something like

Code:
<a href="#" onclick="javascript:window.open('http://digg.com/remote-submit?phase=2&amp;url='+ document.URL + '&amp;title=' + document.title)">Digg</a>

not entirely sure if it'll work ...
 

Simona

New Member
Wow, now you really helped me again. Thanks a million - it works! Well, I did small changes - some space and a few '' - but this is really brilliant!

So here is the final code (now working):

Code:
<a href="#" onclick="javascript:window.open('http://digg.com/remote-submit?phase=2&amp;url=' + document.URL + '&amp;title=' + document.title + '')">Digg</a>
 
Status
Not open for further replies.
Top