In most email clients i've tried javascript in, it doesn't work. As john pointed out, the answers to this post points out why it is usually disabled;
I'm afraid such functionality, while theoretically possible, wouldn't be very practical given that most email clients strip out or disable JavaScript in order to prevent malicious code execution or other security issues
I guess you could use it if you know your audience very well, since, as the first answer to this post (written in 2010 so don't get your hopes up too much)
Lotus Notes, Mozilla Thunderbird, Outlook Express, and Windows Live Mail all seem to support some sort of JavaScript execution. Nothing else does.
A last resort might be writing a virus that gets into the computer just by opening the email, and then alternating the source code of the email client to enable javascript functionality. I wouldn't recommend that, though.
Use a linked photo instead. please.