Download Issue Fixed
Friday, February 2nd, 2007A Mac user wrote to say he visited our website but couldn’t download anything. Nothing happened when he clicked on the download links. Later that same day, I got another email from him saying he had solved the problem. It turned out JavaScript on his browser was disabled.
A few months back, I introduced the use of JavaScript for our download links. Long story short, this was part of my effort to add Google AdWords conversion tracking. Due to my oversight, browsers with JavaScript disabled hadn’t been able to download software from our website for the last few months!
After some googling, I found this very elegant solution. All I had to do was change all occurrences of anchor tags that looked like this:
<a href="javascript:download('EC')">
to this:
<a href="/download/EasyCrop.dmg"
onClick="javascript:download('EC');return false">
When JavaScript is unavailable, the second tag behaves just like a regular tag to a static file. With JavaScript enabled, the second tag behaves just like the first one. The “return false” ensures that the href link isn’t followed after executing the script.