[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 214
  • Last Modified:

Linking an image within javascript

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
ddantes
Asked:
ddantes
  • 4
  • 3
2 Solutions
 
skipper68Application Development ManagerCommented:
What is the url to the image?
0
 
skipper68Application Development ManagerCommented:
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
 
ddantesAuthor Commented:
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
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
skipper68Application Development ManagerCommented:
You could try this:
document.write("<a href=\""+theImages[whichImage]+"\" target=\"_blank\"><img src=\""+theImages[whichImage]+"\" \/><\/a>");
0
 
ddantesAuthor Commented:
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
 
Sar1973Commented:
You can change the link of the image by using document.getElementById("IMGname/ID").src=(image URL).
0
 
ddantesAuthor Commented:
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
 
ddantesAuthor Commented:
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

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now