Solved

Linking an image within javascript

Posted on 2013-05-27
8
204 Views
Last Modified: 2013-05-28
I've attached a page with code which links to an external site.  The link appears as a date.  I would like to add a gif image to that link.  I'm having some difficulty including an image within the javascript.   Please advise.test.htm
0
Comment
Question by:ddantes
  • 4
  • 3
8 Comments
 
LVL 9

Expert Comment

by:skipper68
ID: 39199880
What is the url to the image?
0
 
LVL 9

Expert Comment

by:skipper68
ID: 39199881
Sorry, maybe I didn't understand your question...
     Are you trying to make the date an image?
     Are you trying to make the URL go to an image?
0
 

Author Comment

by:ddantes
ID: 39199891
Thank you for your reply.  I would like my own image to replace the date.  I don't want to change the link target, just the appearance of the link.
0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
LVL 9

Assisted Solution

by:skipper68
skipper68 earned 125 total points
ID: 39199975
You could try this:
document.write("<a href=\""+theImages[whichImage]+"\" target=\"_blank\"><img src=\""+theImages[whichImage]+"\" \/><\/a>");
0
 

Author Comment

by:ddantes
ID: 39199987
Thank you.  Unfortunately, due to lack of expertise, I don't know how to implement your instructions.  Below is the existing code.  Would you mind inserting the code you provided where it belongs, and I will test it?


<!-- BEGIN DigiCert Site Seal Code -->
<center><div id="digicertsitesealcode" style="width: 81px; margin: 5px auto 5px auto;"></div></center>
<script language="javascript" type="text/javascript"
src="https://www.digicert.com/custsupport/sealtable.php?order_id=00259924&seal_type=a&seal_size=large&seal_color=blue&new=1">
</script>

<script language="javascript" type="text/javascript">coderz();</script>
<!-- END DigiCert Site Seal Code -->
0
 
LVL 9

Accepted Solution

by:
Sar1973 earned 125 total points
ID: 39202017
You can change the link of the image by using document.getElementById("IMGname/ID").src=(image URL).
0
 

Author Comment

by:ddantes
ID: 39202869
Thank you.  Would you mind showing me where that code needs to be inserted, with respect to the code shown in my previous comment?
0
 

Author Comment

by:ddantes
ID: 39203499
It turns out that the image, appearing as a date, is generated by javascript on a remote server.  It's apparently not subject to having my own image substituted.  Thanks to both experts for responding.
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now