问题
I'm wondering, is it possible to use a Click To Print button in an email newsletter? Similar to the window.print() method, but I'm not sure if emails can contain javascript?
回答1:
I don't think so, and if it is, it's not advised. I'm not sure if you tried Googling your question first, but check this out. Also, this. You could redirect them to a webpage containing the javascript. That might work.
回答2:
not that I can think of.
Alternative: Do you have the newsletter duplicated on your site for those that might "click here if you can't see this email correctly"?
You could add a querystring to the URL (http://www.mysite.com/newsletter1.htm?print=yes) then check the URL in javascript and fire off the window.print if the querystring is there.
?
来源:https://stackoverflow.com/questions/17491255/can-i-use-a-click-to-print-button-in-an-email-newsletter