Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
text link in javascript?
Old 03-23-2009, 05:55 AM text link in javascript?
Skilled Talker

Posts: 62
Name: Andrew
Trades: 0
I have this code:

Code:
<script type="text/javascript" src="http://cdn.socialtwist.com/2009032213254/script.js"></script><a class="st-taf" href="http://tellafriend.socialtwist.com:80" onclick="return false;" style="border:0;padding:0;margin:0;"><img src="/images/icons/emailshare.png" alt="SocialTwist Tell-a-Friend" align="absbottom" style="border:0;padding:0;margin:0;" onclick="cw(this, {id:'2009032213254', link: window.location, title: document.title });" onmouseover="showHoverMap(this, '2009032213254', window.location, document.title)"onmouseout="hideHoverMap(this)"/></a>
I've been trying unsuccessfully to change the /images/icons/emailshare.png part of the code from an image to a text link, such as "Share By Email"

I'm not even sure if this is possible (3rd part script). Any suggestions greatly appreciated.
andrew99 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-23-2009, 09:45 AM Re: text link in javascript?
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
delete the image, put anchor text there instead and put the inline script on the anchor element.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-23-2009, 11:26 AM Re: text link in javascript?
Average Talker

Posts: 17
Name: Dejan
Location: Macedonia
Trades: 0
Code:
<script type="text/javascript" src="http://cdn.socialtwist.com/2009032213254/script.js"></script><a class="st-taf" href="http://tellafriend.socialtwist.com:80" onclick="return false;" style="border:0;padding:0;margin:0;">YOUR TEXT</a>
is this what you want?
DeJaaaN is offline
Reply With Quote
View Public Profile Visit DeJaaaN's homepage!
 
Old 03-23-2009, 02:27 PM Re: text link in javascript?
Skilled Talker

Posts: 62
Name: Andrew
Trades: 0
Replacing the image with anchor text is the first thing I tried before creating this topic. The link shows up, but no action (mouseover, click, etc) gets any type of result.

DeJaaaN - I tried the code you suggested with no luck - same thing, nothing happens. Yikes!

chrishirst - if you get a chance, please let me know what you mean about

Quote:
put the inline script on the anchor element.
Thank you for any suggestions.
andrew99 is offline
Reply With Quote
View Public Profile
 
Old 03-23-2009, 02:37 PM Re: text link in javascript?
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,985
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
an inline script "on an element" is something that appears right in the HTML, and also not inside of <script></script> tags. In other words, inside of an event attribute (like onclick), or in an href attribute, using the javascript: psuedoprotocol.

This is not something that I normally recommend doing, since I am a believer in separating behavior from presentation, but it can be a quick fix in some situations, as well as being important to understand, since it appears in many places.
__________________
Join me on
Please login or register to view this content. Registration is FREE
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 03-23-2009, 03:35 PM Re: text link in javascript?
Skilled Talker

Posts: 62
Name: Andrew
Trades: 0
Yes! - This code does the job:

Code:
<script type="text/javascript" src="http://cdn.socialtwist.com/2009032213254/script.js"></script><a class="st-taf" href="http://tellafriend.socialtwist.com:80" style="border:0;padding:0;margin:0;" onclick="cw(this, {id:'2009032213254', link: window.location, title: document.title }); return false;">test</a>
I tested it and it seems to work. Special thanks to chrishirst and wayfarer07 for explaining this. Would have taken me weeks to figure it out on my own.
andrew99 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to text link in javascript?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.22835 seconds with 12 queries