Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need some help with a basic Bit.Ly javascript tool

Status
Not open for further replies.

nickbonich

Programmer
Mar 21, 2009
2
AU
Hi guys,

Am a super-novice programmer - am in the middle of building our new website - and need some help getting a great script from Bit.Ly to work.

Code/info (from Bit.Ly) is:

********************************************

bit.ly Tweet & Track Chicklet
Make it easy for your readers to share links to your content on Twitter and track who clicks them.
Copy these two lines into the head tag of your HTML page:

<script type="text/javascript" charset="utf-8" src="<script type="text/javascript" charset="utf-8" src="
Then, add this with each item on your blog or content site:

<a href="#" onclick="return TweetAndTrack.open(this, '{Permalink}');"><span style="display:none;">Your custom message - {Title}</span>Tweet & Track</a>

Substitute whatever template tag or variable you use for permalinks for {Permalink} and your Post Title template tag for {Title}. You can also add a common custom message where it says "Your custom message - ". This example will work on Tumblr.

********************************************

I have inserted the code on my page and the link works (ie. a new Twiter window is launched with the message entered - ready to send) - but the resulting Bit.Ly url does not work. This, I am told, is due to the {Permalink} reference (for Tumblr) - which doesn't work outside a blog environment? Can anyone help me adapt the script/usage to suit a basic website?

I would really appreciate any support here - even a point in the right direction.

Thank you very much - look forward to hearing from you.
 
Some info about Permalinks

Btw, I hope you understand the posible risks of adding external javascript references to your website. For example, if bit.ly is down, your website won't run.

And maybe can be detected as some kind of redirection by your users' antivirus.

Cheers,
Dian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top