Authors

Email Design

Email Design Tip of the Week: JavaScript in Email?

Thursday, September 3, 2009 by Andrea Smith
written by Michael Moriarty

Currently, Javascript paired with HTML is more or less the norm on the web as a large percentage of websites use it for high-level functionality. Why then aren’t we seeing more Javascript-infused email campaigns? Is it even possible? Including Javascript in email is possible, but that doesn’t mean it should be included. Let’s examine why.

Email Marketing Design 

JavaScript is stripped out of HTML email by default in all major email clients. JavaScript is a powerful vector for executing malicious code on a user’s computer — let’s compare a user’s experience browsing the web against a user browsing their email inbox. A user browsing the web has more control to avoid dangerous websites. If a website looks sketchy, it’s common sense to not click anything except the ‘back’ button. With web, there’s an opportunity to visually inspect a link’s destination or surroundings before clicking anything. Modern browsers also help protect users against phishing and virus-laden websites by letting the user know that they are about to stumble into a dangerous area.
 
Email, however, puts the control in the hands of the sender. This is one reason why so many malicious emails exist, as opposed to websites. The recipient only has the from name and the subject line to judge whether or not to open an email, both of which can be manipulated by spammers. Spam filters are in place to help mitigate this problem, and while they do a pretty good job, some spam may eventually make it through. JavaScript can be used to perform malicious activities upon email open, so if the from name and subject line are crafted properly, it can be very difficult to avoid being compromised by an email containing malicious JavaScript. As a result, all major email clients strip JavaScript out of emails by default. You can include JavaScript in your email to your hearts content, but doing so could harm your deliverability and cause your email to end up in the junk or spam folder.
 
Thankfully, JavaScript isn’t necessary to craft a successful email campaign. Consult our design best practices whitepaper if you are having trouble getting the results you expect, or if you DO want to use JavaScript, include it in a landing page — check out our landing page field guide.
 
return 0;
Mike

Comments for Email Design Tip of the Week: JavaScript in Email?

Leave a comment





Captcha