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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Image onclick problem 1

Status
Not open for further replies.

aharrisreid

Programmer
Nov 17, 2000
312
GB

I would like to have an image, which when clicked-on produces the standard IE 'Save as' dialog.

The following code works, but when the pointer hovers over the image I want the 'pointing finger' to appear. I think this may need the addition href=&quot;&quot;, but how? A blank href wants to display the parent folder! Can I get the finger with out using <a></a> ?

<a>
<img src=&quot;MyImage.gif&quot;
onclick=document.execCommand('SaveAs',true,'MyFile.txt')>
</a>

Any help would be appreciated.

Alan
 
The ConeHead, many thanks for the reply, I only posted the question 10 minutes ago!

>>href=&quot;#&quot;<<

It works! Brilliant. How do you come across this stuff? Is there a resource that you could recommend which mentions nuggets like this workaround?

Regards,
Alan

 
use javascript:; instead of #

the reason for this is that # will send the page back to the top all the time [Hammer]
Nike Failed Slogans -- &quot;Just Don't Do It!&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top